Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3401940
D7990.id27076.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D7990.id27076.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 3, 2:36 PM (2 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2611768
Default Alt Text
D7990.id27076.diff (1 KB)
Attached To
Mode
D7990: [native] Minor updates to UsernameSelection
Attached
Detach File
Event Timeline
Log In to Comment