Don't set isValid on isDiabled (InputNumber) (#1152)

This commit is contained in:
Jaco Greeff 2019-05-14 17:19:17 +02:00 committed by GitHub
parent b8968ed1f7
commit 5f0c9543d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,7 +51,7 @@ class InputNumber extends React.PureComponent<Props, State> {
constructor (props: Props) {
super(props);
const { defaultValue, isSi, value } = this.props;
const { defaultValue, isDisabled, isSi, value } = this.props;
let valueBN = new BN(value || 0);
const si = formatBalance.findSi('-');
@ -60,7 +60,7 @@ class InputNumber extends React.PureComponent<Props, State> {
? new BN(defaultValue || valueBN).div(new BN(10).pow(new BN(si.power))).toString()
: (defaultValue || valueBN).toString(),
isPreKeyDown: false,
isValid: !isUndefined(value),
isValid: isDisabled || !isUndefined(value),
siOptions: formatBalance.getOptions().map(({ power, text, value }) => ({
value,
text: power === 0