File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 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(
160160 const userTypingRef = React . useRef ( false ) ;
161161 const compositionRef = React . useRef ( false ) ;
162162 const shiftKeyRef = React . useRef ( false ) ;
163+ const imeCompositionRef = React . useRef ( false ) ;
163164
164165 // ============================ Value =============================
165166 // Real value control
@@ -428,6 +429,9 @@ const InternalInputNumber = React.forwardRef(
428429
429430 // >>> Input
430431 const onInternalInput : React . ChangeEventHandler < HTMLInputElement > = ( e ) => {
432+ if ( imeCompositionRef . current && ! compositionRef . current ) {
433+ return ;
434+ }
431435 collectInputValue ( e . target . value ) ;
432436 } ;
433437
@@ -498,6 +502,12 @@ const InternalInputNumber = React.forwardRef(
498502
499503 shiftKeyRef . current = shiftKey ;
500504
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+
501511 if ( key === 'Enter' ) {
502512 if ( ! compositionRef . current ) {
503513 userTypingRef . current = false ;
@@ -543,6 +553,8 @@ const InternalInputNumber = React.forwardRef(
543553
544554 // >>> Focus & Blur
545555 const onBlur = ( ) => {
556+ imeCompositionRef . current = false ;
557+
546558 if ( changeOnBlur ) {
547559 flushInputValue ( false ) ;
548560 }
You can’t perform that action at this time.
0 commit comments