Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Actually fix it this time
  • Loading branch information
regalijan committed Mar 2, 2024
1 parent fe6065f commit 997bf0b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/routes/et-members.tsx
Expand Up @@ -292,17 +292,15 @@ export default function () {
<Input
maxLength={20}
onBeforeInput={(e) => {
const {
data,
}: { data?: string } & FormEvent<HTMLInputElement> = e;
const data = (e.target as HTMLInputElement).value as string;

if (!data) return;

if (
data.match(/\W/) ||
data.length > 20 ||
// Need Number pseudo-constructor since matches might be null
Number(data.match(/_/g)?.length) > 1 ||
(data.match(/_/g)?.length || 0) > 1 ||
data.startsWith("_")
)
e.preventDefault();
Expand Down

0 comments on commit 997bf0b

Please sign in to comment.