Allow 0x input on Bytes (#5651)

* Allow 0x input on Bytes

* Unbreak non-empty inputs

* Adjust to prior order
This commit is contained in:
Jaco 2021-06-22 10:26:29 +03:00 committed by GitHub
parent 11794d7d9c
commit aa75b6ebc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,7 +80,7 @@ function BaseBytes ({ asHex, children, className = '', defaultValue: { value },
isValid = isValid && validate(value) && (
length !== -1
? value.length === length
: value.length !== 0
: (value.length !== 0 || hex === '0x')
);
if (withLength && isValid) {