mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Trimming whitespace in ENSInput (#11631)
This commit is contained in:
parent
709369dc14
commit
813eef6080
@ -37,16 +37,17 @@ export default class EnsInput extends Component {
|
|||||||
|
|
||||||
onPaste = (event) => {
|
onPaste = (event) => {
|
||||||
event.clipboardData.items[0].getAsString((text) => {
|
event.clipboardData.items[0].getAsString((text) => {
|
||||||
|
const input = text.trim();
|
||||||
if (
|
if (
|
||||||
!isBurnAddress(text) &&
|
!isBurnAddress(input) &&
|
||||||
isValidHexAddress(text, { mixedCaseUseChecksum: true })
|
isValidHexAddress(input, { mixedCaseUseChecksum: true })
|
||||||
) {
|
) {
|
||||||
this.props.onPaste(text);
|
this.props.onPaste(input);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
onChange = (e) => {
|
onChange = ({ target: { value } }) => {
|
||||||
const {
|
const {
|
||||||
onValidAddressTyped,
|
onValidAddressTyped,
|
||||||
internalSearch,
|
internalSearch,
|
||||||
@ -54,7 +55,7 @@ export default class EnsInput extends Component {
|
|||||||
lookupEnsName,
|
lookupEnsName,
|
||||||
resetEnsResolution,
|
resetEnsResolution,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const input = e.target.value;
|
const input = value.trim();
|
||||||
|
|
||||||
onChange(input);
|
onChange(input);
|
||||||
if (internalSearch) {
|
if (internalSearch) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user