1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-22 09:23:21 +01:00

Fix: UnitInput too narrow for small and trailing zeroed numbers (#20666)

* fix: UnitInput too narrow for small and trailing zeroed numbers

* lint

---------

Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
This commit is contained in:
Brian Bergeron 2023-08-31 09:29:29 -05:00 committed by GitHub
parent 90a89f3f5b
commit 1e558af3b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,7 +38,10 @@ export default class UnitInput extends PureComponent {
const { value: propsValue } = this.props;
const { value: stateValue } = this.state;
if (prevPropsValue !== propsValue && propsValue !== stateValue) {
if (
prevPropsValue !== propsValue &&
Number(propsValue) !== Number(stateValue)
) {
this.setState({ value: propsValue });
}
}