Merge pull request woocommerce/woocommerce-admin#1119 from woocommerce/fix/1115-number-filter-uncontrolled-warning

Fix “uncontrolled input” warning in NumberFilter component.
This commit is contained in:
Jeff Stieler 2018-12-18 16:34:39 -07:00 committed by GitHub
commit a96272a5fe
1 changed files with 3 additions and 3 deletions

View File

@ -67,14 +67,14 @@ class NumberFilter extends Component {
suffix={ <span dangerouslySetInnerHTML={ { __html: currencySymbol } } /> }
className="woocommerce-filters-advanced__input"
type="number"
value={ value }
value={ value || '' }
onChange={ onChange }
/>
: <TextControlWithAffixes
prefix={ <span dangerouslySetInnerHTML={ { __html: currencySymbol } } /> }
className="woocommerce-filters-advanced__input"
type="number"
value={ value }
value={ value || '' }
onChange={ onChange }
/>
);
@ -84,7 +84,7 @@ class NumberFilter extends Component {
<TextControl
className="woocommerce-filters-advanced__input"
type="number"
value={ value }
value={ value || '' }
onChange={ onChange }
/>
);