]> Untitled Git - lemmy-ui.git/commitdiff
trim all username state input
authorAlec Armbruster <alectrocute@gmail.com>
Wed, 14 Jun 2023 13:47:33 +0000 (09:47 -0400)
committerAlec Armbruster <alectrocute@gmail.com>
Wed, 14 Jun 2023 13:47:33 +0000 (09:47 -0400)
src/shared/components/home/login.tsx
src/shared/components/home/setup.tsx
src/shared/components/home/signup.tsx

index 87ef234e543ca3461012c05438da3bc8af8241b7..949155424d8ee933136ed84d76f6307a06b90db9 100644 (file)
@@ -195,7 +195,7 @@ export class Login extends Component<any, State> {
   }
 
   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);
   }
 
index 581c1c563db33eb685c48b70f4d2c3c9babbf6db..14350a58805afe362b4d3158f9d28b658872806d 100644 (file)
@@ -221,7 +221,7 @@ export class Setup extends Component<any, State> {
   }
 
   handleRegisterUsernameChange(i: Setup, event: any) {
-    i.state.form.username = event.target.value;
+    i.state.form.username = event.target.value.trim();
     i.setState(i.state);
   }
 
index 3efeac6208e104b99b3cf123dbc1afeceaa495a0..16a3cc6d3eef61dbb4624a6acdefaf90429b3009 100644 (file)
@@ -496,7 +496,7 @@ export class Signup extends Component<any, State> {
   }
 
   handleRegisterUsernameChange(i: Signup, event: any) {
-    i.state.form.username = event.target.value;
+    i.state.form.username = event.target.value.trim();
     i.setState(i.state);
   }