update input keyboard return key labels

This commit is contained in:
ammarahm-ed
2021-04-05 10:25:05 +05:00
parent 8a67c3daf4
commit 76a44aa61a
4 changed files with 28 additions and 1 deletions

View File

@@ -320,6 +320,8 @@ export class AddNotebookDialog extends React.Component {
onSubmit={() => {
this.descriptionRef.focus();
}}
returnKeyLabel="Next"
returnKeyType="next"
defaultValue={toEdit ? toEdit.title : null}
/>
@@ -333,6 +335,8 @@ export class AddNotebookDialog extends React.Component {
onSubmit={() => {
this.topicInputRef.current?.focus();
}}
returnKeyLabel="Next"
returnKeyType="next"
defaultValue={toEdit ? toEdit.description : null}
/>
@@ -350,6 +354,8 @@ export class AddNotebookDialog extends React.Component {
});
}
}}
returnKeyLabel="Done"
returnKeyType="done"
onSubmit={() => {
this.onSubmit();
}}

View File

@@ -128,6 +128,8 @@ export class AddTopicDialog extends React.Component {
defaultValue={this.toEdit ? this.toEdit.title : null}
placeholder="Enter title of topic"
onSubmit={() => this.addNewTopic()}
returnKeyLabel="Done"
returnKeyType="done"
/>
<DialogButtons

View File

@@ -53,6 +53,8 @@ export const SearchInput = (props) => {
paddingHorizontal: 0,
margin: 0,
}}
returnKeyLabel="Search"
returnKeyType="search"
textAlignVertical="center"
onChangeText={onChangeText}
multiline={false}

View File

@@ -333,7 +333,6 @@ export class VaultDialog extends Component {
this.setState({
loading: false,
});
}
}
@@ -608,6 +607,13 @@ export class VaultDialog extends Component {
? 0
: 10
}
onSubmit={() => {
changePassword
? changePassInputRef.current?.focus()
: this.onPress;
}}
returnKeyLabel={changePassword ? 'Next' : this.state.title}
returnKeyType={changePassword ? 'next' : 'done'}
secureTextEntry
placeholder={changePassword ? 'Current password' : 'Password'}
/>
@@ -636,6 +642,9 @@ export class VaultDialog extends Component {
onChangeText={(value) => {
this.newPassword = value;
}}
onSubmit={this.onPress}
returnKeyLabel="Change"
returnKeyType="done"
secureTextEntry
placeholder={'New password'}
/>
@@ -651,7 +660,12 @@ export class VaultDialog extends Component {
onChangeText={(value) => {
this.password = value;
}}
returnKeyLabel="Next"
returnKeyType="next"
secureTextEntry
onSubmit={() => {
confirmPassRef.current?.focus();
}}
placeholder="Password"
/>
@@ -665,6 +679,8 @@ export class VaultDialog extends Component {
errorMessage="Passwords do not match."
onErrorCheck={(e) => null}
marginBottom={0}
returnKeyLabel="Create"
returnKeyType="done"
onChangeText={(value) => {
this.confirmPassword = value;
if (value !== this.password) {
@@ -677,6 +693,7 @@ export class VaultDialog extends Component {
});
}
}}
onSubmit={this.onPress}
placeholder="Confirm password"
/>
</View>