-
Notifications
You must be signed in to change notification settings - Fork 24.2k
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
[InputAccessoryView] Does not support device orientation change #27887
Comments
I looked into T27974328, which is a reference to a task in our (Facebook's) internal task tracker, but that task refers to a different issue with InputAccessoryView. From what I could see in a related task, it looks like we're aware that InputAccessoryView doesn't work that great in landscape, and any PR that helps here would be appreciated. |
Ok so the reason for
This is because the screen size is calculated once and cached. react-native/React/Base/RCTUtils.m Lines 304 to 310 in 619d5d6
I think the right fix would be to remove the fixed width for the subviews and use AutoLayout constraints. The react-native/Libraries/Text/TextInput/RCTInputAccessoryViewContent.m Lines 67 to 71 in 619d5d6
I am still trying to figure out the lifecycle of view/shadow view/view managers, I shall update here if I make any progress. @hramos @demchenkoalex @PeteTheHeat @janicduplessis Please share your thoughts if any. |
I guess it will not be so simple to fix, moreover, I have experienced another bug with |
@demchenkoalex Is this a good issue to get started on? I'd love to take a stab at it. |
@chirag-singhal I think this is a decent issue to get started on, input accessory view was the first thing I built when I started working on React Native (which is why it has a bunch of edge case bugs like this). Some thoughts:
|
@PeteTheHeat Anybody can take this issue, I broke my mac screen while working today. So i have to shift to another laptop which runs on linux OS. Can you tell me any issue which i can work on? |
What's the status of this issue? Still a bug in RN 0.62.2 |
Still a bug in RN 0.66.3 |
Present in 0.70.2 |
Any update on this? |
Hey all, just FYI that I have a fix for both Fabric and old renderer here. |
Hi everyone.
I've noticed that InputAccessoryView does not change its width when device orientation changes (related #24473). Moreover, if app is initially ran in landscape mode, right part (usually send button) is going off-screen, see examples below.
As stated in this comment my understanding that this is a known issue and it is being tracked somewhere (
T27974328
?)react-native/Libraries/Text/TextInput/RCTInputAccessoryViewContent.m
Line 26 in 30491a2
I am more than happy to fix this myself and submit a PR, however after 3 hours of trying I just don't know where to go. Maybe somebody can share some thoughts about this issue. My only observation is that the latest PR #21179 with changes to the safe area was using code very similar to https://github.com/stockx/SafeAreaInputAccessoryViewWrapperView/blob/master/SafeAreaInputAccessoryViewWrapperView/Classes/SafeAreaInputAccessoryViewWrapperView.swift and width is resizing normally in this native code, so the problem might be deeper than in the
RCTInputAccessoryViewContent.m
class.React Native version:
Steps To Reproduce
Describe what you expected to happen:
InputAccessoryView's width automatically resizes when changing between portrait and landscape orientation. Trailing layout anchor is preserving safe area boundaries (right now it's off-screen if ran from landscape).
Snack, code example, screenshot, or link to a repository:
https://github.com/facebook/react-native/tree/master/RNTester#30491a208513451efa6c2a62a116c61b21363a22
Ran in portrait mode example GIF: https://imgur.com/a/TE3VxxI
Ran in landscape mode example GIF: https://imgur.com/a/4bt5LPz
The text was updated successfully, but these errors were encountered: