File tree 2 files changed +4
-2
lines changed
client/a8c-for-agencies/components/a4a-number-input-v2
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -501,6 +501,7 @@ module.exports = {
501
501
'__experimentalNavigatorProvider' ,
502
502
'__experimentalNavigatorScreen' ,
503
503
'__experimentalUseNavigator' ,
504
+ '__experimentalNumberControl' ,
504
505
'__unstableComposite' ,
505
506
'__unstableCompositeItem' ,
506
507
'__unstableUseCompositeState' ,
Original file line number Diff line number Diff line change 1
- // eslint-disable-next-line wpcalypso/no-unsafe-wp-apis
2
1
import { __experimentalNumberControl as NumberControl } from '@wordpress/components' ;
3
2
4
3
import './style.scss' ;
@@ -19,7 +18,9 @@ export default function A4ANumberInputV2( {
19
18
increment = 1 ,
20
19
} : Props ) {
21
20
const handleOnChange = ( newValue : unknown ) => {
22
- onChange ( newValue as number ) ;
21
+ // Force convert to number, if NaN use minimum
22
+ const numberValue = Number ( newValue ) || minimum ;
23
+ onChange ( numberValue ) ;
23
24
} ;
24
25
25
26
return (
You can’t perform that action at this time.
0 commit comments