File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -160,6 +160,7 @@ const InternalInputNumber = React.forwardRef(
160
160
const userTypingRef = React . useRef ( false ) ;
161
161
const compositionRef = React . useRef ( false ) ;
162
162
const shiftKeyRef = React . useRef ( false ) ;
163
+ const imeCompositionRef = React . useRef ( false ) ;
163
164
164
165
// ============================ Value =============================
165
166
// Real value control
@@ -428,6 +429,9 @@ const InternalInputNumber = React.forwardRef(
428
429
429
430
// >>> Input
430
431
const onInternalInput : React . ChangeEventHandler < HTMLInputElement > = ( e ) => {
432
+ if ( imeCompositionRef . current && ! compositionRef . current ) {
433
+ return ;
434
+ }
431
435
collectInputValue ( e . target . value ) ;
432
436
} ;
433
437
@@ -498,6 +502,12 @@ const InternalInputNumber = React.forwardRef(
498
502
499
503
shiftKeyRef . current = shiftKey ;
500
504
505
+ if ( ( event . key === 'Process' && event . code !== 'NumpadEnter' && event . code !== 'Enter' ) || compositionRef . current ) {
506
+ imeCompositionRef . current = true ;
507
+ } else {
508
+ imeCompositionRef . current = false ;
509
+ }
510
+
501
511
if ( key === 'Enter' ) {
502
512
if ( ! compositionRef . current ) {
503
513
userTypingRef . current = false ;
@@ -543,6 +553,8 @@ const InternalInputNumber = React.forwardRef(
543
553
544
554
// >>> Focus & Blur
545
555
const onBlur = ( ) => {
556
+ imeCompositionRef . current = false ;
557
+
546
558
if ( changeOnBlur ) {
547
559
flushInputValue ( false ) ;
548
560
}
You can’t perform that action at this time.
0 commit comments