Skip to content

Commit

Permalink
fix: fix the problem that children of TextInput would be cleared when…
Browse files Browse the repository at this point in the history
… setting the selection prop
  • Loading branch information
ZhuoYitao committed Dec 29, 2023
1 parent b5e08e8 commit 231ccb8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,8 @@ function InternalTextInput(props: Props): React.Node {
? props.value
: typeof props.defaultValue === 'string'
? props.defaultValue
: typeof props.value === 'undefined'
? null
: '';

// This is necessary in case native updates the text and JS decides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ describe('TextInput compat with web', () => {
}
}
submitBehavior="blurAndSubmit"
text=""
text={null}
underlineColorAndroid="transparent"
/>
`);
Expand Down

0 comments on commit 231ccb8

Please sign in to comment.