From 520efdcadaab0eff3c50f78d1bbc9412c072d4fe Mon Sep 17 00:00:00 2001 From: Alec Armbruster Date: Wed, 14 Jun 2023 09:47:33 -0400 Subject: [PATCH] trim all username state input --- src/shared/components/home/login.tsx | 2 +- src/shared/components/home/setup.tsx | 2 +- src/shared/components/home/signup.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shared/components/home/login.tsx b/src/shared/components/home/login.tsx index 87ef234..9491554 100644 --- a/src/shared/components/home/login.tsx +++ b/src/shared/components/home/login.tsx @@ -195,7 +195,7 @@ export class Login extends Component { } handleLoginUsernameChange(i: Login, event: any) { - i.state.form.username_or_email = event.target.value; + i.state.form.username_or_email = event.target.value.trim(); i.setState(i.state); } diff --git a/src/shared/components/home/setup.tsx b/src/shared/components/home/setup.tsx index 581c1c5..14350a5 100644 --- a/src/shared/components/home/setup.tsx +++ b/src/shared/components/home/setup.tsx @@ -221,7 +221,7 @@ export class Setup extends Component { } handleRegisterUsernameChange(i: Setup, event: any) { - i.state.form.username = event.target.value; + i.state.form.username = event.target.value.trim(); i.setState(i.state); } diff --git a/src/shared/components/home/signup.tsx b/src/shared/components/home/signup.tsx index 3efeac6..16a3cc6 100644 --- a/src/shared/components/home/signup.tsx +++ b/src/shared/components/home/signup.tsx @@ -496,7 +496,7 @@ export class Signup extends Component { } handleRegisterUsernameChange(i: Signup, event: any) { - i.state.form.username = event.target.value; + i.state.form.username = event.target.value.trim(); i.setState(i.state); } -- 2.44.1