Skip to content

Commit

Permalink
Lowercasing event.target.value while entering snapshotENS
Browse files Browse the repository at this point in the history
  • Loading branch information
mudrila committed Aug 16, 2024
1 parent c7f658f commit 0f7888d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export function EstablishEssentials(props: ICreationStepProps) {
<Input
value={values.essentials.snapshotENS}
onChange={cEvent =>
setFieldValue('essentials.snapshotENS', cEvent.target.value, true)
setFieldValue('essentials.snapshotENS', cEvent.target.value.toLowerCase(), true)
}
isDisabled={snapshotENSDisabled}
data-testid="essentials-snapshotENS"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ export function MetadataContainer() {
}, [daoName, daoSnapshotENS, daoAddress]);

const handleSnapshotENSChange: ChangeEventHandler<HTMLInputElement> = e => {
setSnapshotENS(e.target.value);
if (validateENSName(e.target.value) || (e.target.value === '' && daoSnapshotENS)) {
const lowerCasedValue = e.target.value.toLowerCase();
setSnapshotENS(lowerCasedValue);
if (validateENSName(lowerCasedValue) || (e.target.value === '' && daoSnapshotENS)) {
setSnapshotENSValid(true);
} else {
setSnapshotENSValid(false);
Expand Down

0 comments on commit 0f7888d

Please sign in to comment.