File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -412,15 +412,17 @@ export default function NumberFormatBase<BaseType = InputAttributes>(
412412 // add input mode on element based on format prop and device once the component is mounted
413413 const inputMode : InputAttributes [ 'inputMode' ] = mounted && addInputMode ( ) ? 'numeric' : undefined ;
414414
415- const inputProps = Object . assign ( { inputMode } , otherProps , {
415+ const inputProps : InputAttributes = {
416+ inputMode,
417+ ...otherProps ,
416418 type,
417419 value : formattedValue ,
418420 onChange : _onChange ,
419421 onKeyDown : _onKeyDown ,
420422 onMouseUp : _onMouseUp ,
421423 onFocus : _onFocus ,
422424 onBlur : _onBlur ,
423- } ) ;
425+ } ;
424426
425427 if ( displayType === 'text' ) {
426428 return renderText ? (
@@ -432,7 +434,6 @@ export default function NumberFormatBase<BaseType = InputAttributes>(
432434 ) ;
433435 } else if ( customInput ) {
434436 const CustomInput = customInput ;
435- /* @ts -ignore */
436437 return < CustomInput { ...inputProps } ref = { getInputRef } /> ;
437438 }
438439
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ export type InputAttributes = Omit<
5252type NumberFormatProps < Props , BaseType = InputAttributes > = Props &
5353 Omit < InputAttributes , keyof BaseType > &
5454 Omit < BaseType , keyof Props | 'ref' > & {
55- customInput ?: React . ComponentType < BaseType > ;
55+ customInput ?: React . ComponentType < React . InputHTMLAttributes < HTMLInputElement > & React . RefAttributes < HTMLInputElement > > ;
5656 } ;
5757
5858export type OnValueChange = ( values : NumberFormatValues , sourceInfo : SourceInfo ) => void ;
You can’t perform that action at this time.
0 commit comments