Skip to content

Commit c3793b3

Browse files
authored
fix: fix safari abnormal behavior (#54)
1 parent d75e44d commit c3793b3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/utils/commonUtils.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,15 @@ export function resolveOnChange<
5353

5454
// Trigger by composition event, this means we need force change the input value
5555
if (targetValue !== undefined) {
56+
const currentTarget = target.cloneNode(true) as E;
57+
5658
event = Object.create(e, {
57-
target: { value: target },
58-
currentTarget: { value: target },
59+
target: { value: currentTarget },
60+
currentTarget: { value: currentTarget },
5961
});
6062
// https://github.com/ant-design/ant-design/issues/45737
61-
if (target.type !== 'file') {
62-
target.value = targetValue;
63+
if (currentTarget.type !== 'file') {
64+
currentTarget.value = targetValue;
6365
}
6466
onChange(event as React.ChangeEvent<E>);
6567
return;

0 commit comments

Comments
 (0)