Page MenuHomePhabricator

D5365.id17566.diff
No OneTemporary

D5365.id17566.diff

diff --git a/native/account/log-in-panel.react.js b/native/account/log-in-panel.react.js
--- a/native/account/log-in-panel.react.js
+++ b/native/account/log-in-panel.react.js
@@ -180,7 +180,7 @@
};
onChangeUsernameInputText: (text: string) => void = text => {
- this.props.logInState.setState({ usernameInputText: text });
+ this.props.logInState.setState({ usernameInputText: text.trim() });
};
onUsernameKeyPress: (event: KeyPressEvent) => void = event => {
diff --git a/web/account/log-in-form.react.js b/web/account/log-in-form.react.js
--- a/web/account/log-in-form.react.js
+++ b/web/account/log-in-form.react.js
@@ -94,12 +94,12 @@
if (username.search(validEmailRegex) > -1) {
setUsername('');
- setErrorMessage('usernames only, not emails');
+ setErrorMessage('Usernames only, not emails');
usernameInputRef.current?.focus();
return;
} else if (username.search(oldValidUsernameRegex) === -1) {
setUsername('');
- setErrorMessage('alphanumeric usernames only');
+ setErrorMessage('Alphanumeric usernames only');
usernameInputRef.current?.focus();
return;
}
@@ -133,6 +133,9 @@
placeholder="Username"
value={username}
onChange={onUsernameChange}
+ onBlur={() => {
+ setUsername(untrimmedUsername => untrimmedUsername.trim());
+ }}
ref={usernameInputRef}
disabled={inputDisabled}
/>
diff --git a/web/modals/input.react.js b/web/modals/input.react.js
--- a/web/modals/input.react.js
+++ b/web/modals/input.react.js
@@ -9,6 +9,7 @@
+placeholder: string,
+value: string,
+onChange: (value: SyntheticEvent<HTMLInputElement>) => mixed,
+ +onBlur?: (value: SyntheticEvent<HTMLInputElement>) => mixed,
+disabled?: boolean,
+label?: string,
+id?: string,

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 5, 10:06 AM (16 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2616704
Default Alt Text
D5365.id17566.diff (1 KB)

Event Timeline