Skip to content

Commit 12fcfa1

Browse files
authored
fix: Safari of input IME (#7918)
1 parent e46d537 commit 12fcfa1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

components/input-number/src/InputNumber.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,11 @@ export default defineComponent({
395395
}
396396
};
397397

398+
// Solve the issue of the event triggering sequence when entering numbers in chinese input (Safari)
399+
const onBeforeInput = () => {
400+
userTypingRef.value = true;
401+
};
402+
398403
const onKeyDown: KeyboardEventHandler = event => {
399404
const { which } = event;
400405
userTypingRef.value = true;
@@ -577,6 +582,7 @@ export default defineComponent({
577582
onBlur={onBlur}
578583
onCompositionstart={onCompositionStart}
579584
onCompositionend={onCompositionEnd}
585+
onBeforeinput={onBeforeInput}
580586
/>
581587
</div>
582588
</div>

0 commit comments

Comments
 (0)