Go back to autofocus and small ui tweak
parent
ed80551278
commit
d385837812
|
@ -137,17 +137,6 @@ export function Component({}: {}) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const textInputRef = React.useCallback((node: TextInput | null) => {
|
|
||||||
if (!node) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// `selectTextOnFocus` isn't working with `autoFocus={true}` or without a timeout going.
|
|
||||||
setTimeout(() => {
|
|
||||||
node.focus()
|
|
||||||
}, 0)
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={[styles.container, pal.view]} testID="addAppPasswordsModal">
|
<View style={[styles.container, pal.view]} testID="addAppPasswordsModal">
|
||||||
<View>
|
<View>
|
||||||
|
@ -171,7 +160,6 @@ export function Component({}: {}) {
|
||||||
{!appPassword ? (
|
{!appPassword ? (
|
||||||
<View style={[pal.btn, styles.textInputWrapper]}>
|
<View style={[pal.btn, styles.textInputWrapper]}>
|
||||||
<TextInput
|
<TextInput
|
||||||
ref={textInputRef}
|
|
||||||
style={[styles.input, pal.text]}
|
style={[styles.input, pal.text]}
|
||||||
onChangeText={_onChangeText}
|
onChangeText={_onChangeText}
|
||||||
value={name}
|
value={name}
|
||||||
|
@ -180,6 +168,7 @@ export function Component({}: {}) {
|
||||||
autoCorrect={false}
|
autoCorrect={false}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
autoCapitalize="none"
|
autoCapitalize="none"
|
||||||
|
autoFocus={true}
|
||||||
maxLength={32}
|
maxLength={32}
|
||||||
selectTextOnFocus={true}
|
selectTextOnFocus={true}
|
||||||
blurOnSubmit={true}
|
blurOnSubmit={true}
|
||||||
|
@ -262,7 +251,6 @@ const styles = StyleSheet.create({
|
||||||
width: '100%',
|
width: '100%',
|
||||||
paddingVertical: 10,
|
paddingVertical: 10,
|
||||||
paddingHorizontal: 8,
|
paddingHorizontal: 8,
|
||||||
marginTop: 6,
|
|
||||||
fontSize: 17,
|
fontSize: 17,
|
||||||
letterSpacing: 0.25,
|
letterSpacing: 0.25,
|
||||||
fontWeight: '400',
|
fontWeight: '400',
|
||||||
|
|
Loading…
Reference in New Issue