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

View File

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

View File

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

View File

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