Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

ux: show correct keyboard return label on login page

ammarahm-edc8351e0b1414
diff --git a/apps/mobile/src/components/Input/index.js b/apps/mobile/src/components/Input/index.js
index b658e8d24..feff42918 100644
--- a/apps/mobile/src/components/Input/index.js
+++ b/apps/mobile/src/components/Input/index.js
@@ -38,6 +38,8 @@ const Input = ({
onPress,
height = 50,
fontSize = SIZE.md,
+ returnKeyType,
+ returnKeyLabel
}) => {
const [state] = useTracked();
const colors = state.colors;
@@ -169,6 +171,9 @@ const Input = ({
keyboardType={
validationType === 'email' ? 'email-address' : 'default'
}
+ returnKeyLabel={returnKeyLabel}
+ returnKeyType={returnKeyType}
+ keyboardAppearance={colors.night ? 'dark' : 'light'}
onFocus={onFocus}
onSubmitEditing={onSubmit}
blurOnSubmit={blurOnSubmit}
diff --git a/apps/mobile/src/components/LoginDialog/index.js b/apps/mobile/src/components/LoginDialog/index.js
index 7e9a2866e..a922969e7 100644
--- a/apps/mobile/src/components/LoginDialog/index.js
+++ b/apps/mobile/src/components/LoginDialog/index.js
@@ -529,12 +529,14 @@ const LoginDialog = () => {
onErrorCheck={(r) => {
setError(r);
}}
+ returnKeyLabel="Next"
+ returnKeyType="next"
validationType="email"
autoCapitalize="none"
errorMessage="Email is invalid"
placeholder="Email"
onSubmit={() => {
- if (mode === MODES.signup) {
+ if (mode === MODES.signup || mode === MODES.login) {
_pass.current?.focus();
}
}}
@@ -550,6 +552,8 @@ const LoginDialog = () => {
onErrorCheck={(r) => {
setError(r);
}}
+ returnKeyLabel="Next"
+ returnKeyType="next"
secureTextEntry
autoCapitalize="none"
placeholder="Current password"
@@ -576,6 +580,8 @@ const LoginDialog = () => {
secureTextEntry
autoCapitalize="none"
placeholder="Password"
+ returnKeyLabel={mode === MODES.signup ? 'Next' : 'Login'}
+ returnKeyType={mode === MODES.signup ? 'next' : 'done'}
errorMessage={mode === MODES.signup && 'Password is invalid'}
onSubmit={() => {
if (
@@ -617,6 +623,8 @@ const LoginDialog = () => {
loading={loading}
validationType="confirmPassword"
autoCapitalize="none"
+ returnKeyLabel="Done"
+ returnKeyType="done"
customValidator={() => password}
secureTextEntry
placeholder="Confirm password"