Skip to content

Commit

Permalink
fix: fix safari abnormal behavior (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
yyz945947732 authored Dec 8, 2023
1 parent d75e44d commit c3793b3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/utils/commonUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@ export function resolveOnChange<

// Trigger by composition event, this means we need force change the input value
if (targetValue !== undefined) {
const currentTarget = target.cloneNode(true) as E;

event = Object.create(e, {
target: { value: target },
currentTarget: { value: target },
target: { value: currentTarget },
currentTarget: { value: currentTarget },
});
// https://github.com/ant-design/ant-design/issues/45737
if (target.type !== 'file') {
target.value = targetValue;
if (currentTarget.type !== 'file') {
currentTarget.value = targetValue;
}
onChange(event as React.ChangeEvent<E>);
return;
Expand Down

0 comments on commit c3793b3

Please sign in to comment.