Skip to content

Commit

Permalink
A4A > Marketplace: Fix WordPress.com hosting discount calculation (#9…
Browse files Browse the repository at this point in the history
  • Loading branch information
yashwin authored Feb 7, 2025
1 parent 87e3946 commit 32fb2ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ module.exports = {
'__experimentalNavigatorProvider',
'__experimentalNavigatorScreen',
'__experimentalUseNavigator',
'__experimentalNumberControl',
'__unstableComposite',
'__unstableCompositeItem',
'__unstableUseCompositeState',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line wpcalypso/no-unsafe-wp-apis
import { __experimentalNumberControl as NumberControl } from '@wordpress/components';

import './style.scss';
Expand All @@ -19,7 +18,9 @@ export default function A4ANumberInputV2( {
increment = 1,
}: Props ) {
const handleOnChange = ( newValue: unknown ) => {
onChange( newValue as number );
// Force convert to number, if NaN use minimum
const numberValue = Number( newValue ) || minimum;
onChange( numberValue );
};

return (
Expand Down

0 comments on commit 32fb2ad

Please sign in to comment.