Actually fix it this time
This commit is contained in:
parent
fe6065f8f6
commit
997bf0bd54
@ -292,9 +292,7 @@ export default function () {
|
|||||||
<Input
|
<Input
|
||||||
maxLength={20}
|
maxLength={20}
|
||||||
onBeforeInput={(e) => {
|
onBeforeInput={(e) => {
|
||||||
const {
|
const data = (e.target as HTMLInputElement).value as string;
|
||||||
data,
|
|
||||||
}: { data?: string } & FormEvent<HTMLInputElement> = e;
|
|
||||||
|
|
||||||
if (!data) return;
|
if (!data) return;
|
||||||
|
|
||||||
@ -302,7 +300,7 @@ export default function () {
|
|||||||
data.match(/\W/) ||
|
data.match(/\W/) ||
|
||||||
data.length > 20 ||
|
data.length > 20 ||
|
||||||
// Need Number pseudo-constructor since matches might be null
|
// Need Number pseudo-constructor since matches might be null
|
||||||
Number(data.match(/_/g)?.length) > 1 ||
|
(data.match(/_/g)?.length || 0) > 1 ||
|
||||||
data.startsWith("_")
|
data.startsWith("_")
|
||||||
)
|
)
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user