Page MenuHomePhabricator

D7990.diff
No OneTemporary

D7990.diff

diff --git a/native/account/registration/username-selection.react.js b/native/account/registration/username-selection.react.js
--- a/native/account/registration/username-selection.react.js
+++ b/native/account/registration/username-selection.react.js
@@ -50,13 +50,13 @@
const validUsername = username.search(validUsernameRegex) > -1;
const [usernameError, setUsernameError] = React.useState<?UsernameError>();
- const styles = useStyles(unboundStyles);
const checkUsernameValidity = React.useCallback(() => {
- if (validUsername) {
- return true;
+ if (!validUsername) {
+ setUsernameError('username_invalid');
+ return false;
}
- setUsernameError('username_invalid');
- return false;
+ setUsernameError(null);
+ return true;
}, [validUsername]);
const exactSearchUserCall = useServerCall(exactSearchUser);
@@ -106,6 +106,7 @@
buttonVariant = 'enabled';
}
+ const styles = useStyles(unboundStyles);
let errorText;
if (usernameError === 'username_invalid') {
errorText = (
@@ -153,7 +154,7 @@
keyboardType="ascii-capable"
textContentType="username"
autoComplete="username-new"
- returnKeyType="next"
+ returnKeyType="go"
onSubmitEditing={onProceed}
editable={!exactSearchUserCallLoading}
onBlur={checkUsernameValidity}

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 3, 1:06 PM (1 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2611768
Default Alt Text
D7990.diff (1 KB)

Event Timeline