Skip to content

Commit

Permalink
chore: code style
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyo837 committed Dec 24, 2023
1 parent 8a7cb9f commit e8777c8
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/utils/commonUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ export function resolveOnChange<
}

// Trigger by composition event, this means we need force change the input value
if (target.type != 'file' && targetValue !== undefined) {
// https://github.com/ant-design/ant-design/issues/45737
// https://github.com/ant-design/ant-design/issues/46598
if (target.type !== 'file' && targetValue !== undefined) {
// A bug report filed on WebKit's Bugzilla tracker, dating back to 2009, specifically addresses the issue of cloneNode() not copying files of <input type="file"> elements.
// As of the last update, this bug was still marked as "NEW," indicating that it might not have been resolved yet​​.
// https://bugs.webkit.org/show_bug.cgi?id=28123
Expand All @@ -65,11 +67,7 @@ export function resolveOnChange<
target: { value: currentTarget },
currentTarget: { value: currentTarget },
});
// https://github.com/ant-design/ant-design/issues/45737
// 'file' check move to above
// if (currentTarget.type !== 'file') {
currentTarget.value = targetValue;
// }
onChange(event as React.ChangeEvent<E>);
return;
}
Expand Down

0 comments on commit e8777c8

Please sign in to comment.