-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iOS] Implement missing showSoftInputOnFocus
prop on TextInput
on the new arch
#35878
Conversation
Base commit: 4c8e253 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for working on this!
cc @sammy-SC
auto const ¤tTextInputProps = *std::static_pointer_cast<TextInputProps const>(_props); | ||
[self _setShowSoftInputOnFocus:currentTextInputProps.traits.showSoftInputOnFocus]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we couple this logic with multiline? regardless, the initial props should go through the updateProps:oldProps pipeline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late reply, I must've missed the notification 😅. It's there because setting multiline
causes the creation of a new underlying component (either RCTUITextView
or RCTUITextField
) and we need to apply the showSoftInputOnFocus
prop again to the newly created view. Otherwise, it will be reset every time the multiline
is set.
This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
|
Not stale |
This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
1 similar comment
This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
Looks like it was implemented in #45298 |
Summary
showSoftInputOnFocus
prop was not implemented on the new architectureTextInput
component on iOS. I added the implementation based on how it's implemented on the old architecture:react-native/Libraries/Text/TextInput/RCTBaseTextInputView.m
Lines 313 to 325 in b314e6f
Changelog
[IOS] [FIXED] - Added missing
showSoftInputOnFocus
onTextInput
on the new architectureTest Plan
Added the prop on the
TextInput
component and checked whether the keyboard opens.