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:
commit
a96272a5fe
|
@ -67,14 +67,14 @@ class NumberFilter extends Component {
|
||||||
suffix={ <span dangerouslySetInnerHTML={ { __html: currencySymbol } } /> }
|
suffix={ <span dangerouslySetInnerHTML={ { __html: currencySymbol } } /> }
|
||||||
className="woocommerce-filters-advanced__input"
|
className="woocommerce-filters-advanced__input"
|
||||||
type="number"
|
type="number"
|
||||||
value={ value }
|
value={ value || '' }
|
||||||
onChange={ onChange }
|
onChange={ onChange }
|
||||||
/>
|
/>
|
||||||
: <TextControlWithAffixes
|
: <TextControlWithAffixes
|
||||||
prefix={ <span dangerouslySetInnerHTML={ { __html: currencySymbol } } /> }
|
prefix={ <span dangerouslySetInnerHTML={ { __html: currencySymbol } } /> }
|
||||||
className="woocommerce-filters-advanced__input"
|
className="woocommerce-filters-advanced__input"
|
||||||
type="number"
|
type="number"
|
||||||
value={ value }
|
value={ value || '' }
|
||||||
onChange={ onChange }
|
onChange={ onChange }
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
@ -84,7 +84,7 @@ class NumberFilter extends Component {
|
||||||
<TextControl
|
<TextControl
|
||||||
className="woocommerce-filters-advanced__input"
|
className="woocommerce-filters-advanced__input"
|
||||||
type="number"
|
type="number"
|
||||||
value={ value }
|
value={ value || '' }
|
||||||
onChange={ onChange }
|
onChange={ onChange }
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue