mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-23 14:57:13 +00:00
[fix] TextInput calls onFocus if autoFocus={true}
The host node ref is not a dependency of the focus handling. Previously, the focus callback was not called if the element was auto-focused, because React DOM calls `onFocus` while the object ref is `null`. Fix #2045
This commit is contained in:
@@ -14,6 +14,13 @@ export default function TextInputPage() {
|
||||
return (
|
||||
<Example title="TextInput">
|
||||
<View style={styles.container}>
|
||||
<TextInput
|
||||
autoFocus
|
||||
onFocus={() => {
|
||||
console.log('focused');
|
||||
}}
|
||||
style={styles.textinput}
|
||||
/>
|
||||
<TextInput
|
||||
blurOnSubmit={true}
|
||||
onSubmitEditing={() => focusNextField()}
|
||||
|
||||
Reference in New Issue
Block a user