Trimming whitespace in ENSInput (#11631)

feature/default_network_editable
ryanml 3 years ago committed by GitHub
parent 709369dc14
commit 813eef6080
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      ui/pages/send/send-content/add-recipient/ens-input.component.js

@ -37,16 +37,17 @@ export default class EnsInput extends Component {
onPaste = (event) => {
event.clipboardData.items[0].getAsString((text) => {
const input = text.trim();
if (
!isBurnAddress(text) &&
isValidHexAddress(text, { mixedCaseUseChecksum: true })
!isBurnAddress(input) &&
isValidHexAddress(input, { mixedCaseUseChecksum: true })
) {
this.props.onPaste(text);
this.props.onPaste(input);
}
});
};
onChange = (e) => {
onChange = ({ target: { value } }) => {
const {
onValidAddressTyped,
internalSearch,
@ -54,7 +55,7 @@ export default class EnsInput extends Component {
lookupEnsName,
resetEnsResolution,
} = this.props;
const input = e.target.value;
const input = value.trim();
onChange(input);
if (internalSearch) {

Loading…
Cancel
Save