1+ import { BaseInput } from '@rc-component/input' ;
12import getMiniDecimal , {
23 DecimalClass ,
34 getNumberPrecision ,
@@ -6,20 +7,20 @@ import getMiniDecimal, {
67 validateNumber ,
78 ValueType ,
89} from '@rc-component/mini-decimal' ;
9- import { clsx } from 'clsx' ;
10- import { BaseInput } from '@rc-component/input' ;
1110import { useLayoutUpdateEffect } from '@rc-component/util/lib/hooks/useLayoutEffect' ;
1211import proxyObject from '@rc-component/util/lib/proxyObject' ;
1312import { composeRef } from '@rc-component/util/lib/ref' ;
13+ import { clsx } from 'clsx' ;
1414import * as React from 'react' ;
1515import useCursor from './hooks/useCursor' ;
16+ import SemanticContext from './SemanticContext' ;
1617import StepHandler from './StepHandler' ;
1718import { getDecupleSteps } from './utils/numberUtil' ;
18- import SemanticContext from './SemanticContext' ;
1919
2020import type { HolderRef } from '@rc-component/input/lib/BaseInput' ;
2121import { BaseInputProps } from '@rc-component/input/lib/interface' ;
2222import { InputFocusOptions , triggerFocus } from '@rc-component/input/lib/utils/commonUtils' ;
23+ import { useEvent } from '@rc-component/util' ;
2324import useFrame from './hooks/useFrame' ;
2425
2526export type { ValueType } ;
@@ -440,7 +441,7 @@ const InternalInputNumber = React.forwardRef(
440441 } ;
441442
442443 // ============================= Step =============================
443- const onInternalStep = ( up : boolean , emitter : 'handler' | 'keyboard' | 'wheel' ) => {
444+ const onInternalStep = useEvent ( ( up : boolean , emitter : 'handler' | 'keyboard' | 'wheel' ) => {
444445 // Ignore step since out of range
445446 if ( ( up && upDisabled ) || ( ! up && downDisabled ) ) {
446447 return ;
@@ -466,7 +467,7 @@ const InternalInputNumber = React.forwardRef(
466467 } ) ;
467468
468469 inputRef . current ?. focus ( ) ;
469- } ;
470+ } ) ;
470471
471472 // ============================ Flush =============================
472473 /**
@@ -591,6 +592,7 @@ const InternalInputNumber = React.forwardRef(
591592 } , [ inputValue ] ) ;
592593
593594 // ============================ Render ============================
595+ // >>>>>> Handler
594596 const upNode = (
595597 < StepHandler action = "up" prefixCls = { prefixCls } disabled = { upDisabled } onStep = { onInternalStep } >
596598 { upHandler }
@@ -608,6 +610,7 @@ const InternalInputNumber = React.forwardRef(
608610 </ StepHandler >
609611 ) ;
610612
613+ // >>>>>> Render
611614 return (
612615 < div
613616 ref = { domRef }
0 commit comments