-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[RNMobile] Prevent always dismissing keyboard when switching away from empty image caption #16759
[RNMobile] Prevent always dismissing keyboard when switching away from empty image caption #16759
Conversation
@@ -270,6 +270,12 @@ class ImageEdit extends React.Component { | |||
); | |||
} | |||
|
|||
// We still want to render the caption so that the soft keyboard is not forced to close on Android |
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.
Nit: even though the comment makes sense in the context of this PR (the change from not rendering at all to rendering with display: none
) it's not so clear when read on its own in the final file version.
What do you think about this instead:
We'll render the caption so that the soft keyboard is not forced to close on Android but still hide it by setting its
display
style tonone
. See wordpress-mobile/gutenberg-mobile#1221
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.
Tried this and works fine!
To be honest though, I think I would consider this a workaround instead of a final fix. I mean, it's still not clear for example why the paragraph that receives the caret is not causing the virtual keyboard to open. To me that feels like there's something more going wrong here.
That said, let's merge this one since it does make the writing flow better but, can you please open a ticket to track our concern?
In the meantime, I only left a comment about adjusting a comment so, feel free to merge after revising it.
So true. 😞 When I initially drafted this PR I called it a hack, but "workaround" is such a nicer way to say it.
That was my thinking in opening this. After finding this "fix", I spent more than a day trying to find the real cause, and I eventually felt like I should just get the fix in since it was small and would be easy to revert later if needed. I'll actually take a second look at this today though to see if taking a day off from the issue has given me the distance to see the issue with new eyes. Thanks @hypest ! |
Issue opened: wordpress-mobile/gutenberg-mobile#1252 |
Related gutenberg-mobile PR
Description
This is a bugfix addresses an issue on Android where switching from an empty caption to another text block would cause the keyboard to be dismissed. The issue appears to occur as a result of the caption not being rendered when it is empty, so it was possible to fix the issue by always "rendering" the caption, but setting it's style's display property to "none" when it should not be visible.
This issue did not occur on iOS and it appears it may be a platform difference (as opposed to an issue with our
RichText
component) because I also observed this same issue when I replaced ourRichText
caption with aTextInput
component.NOTE: This PR only fixes this issue for image captions. The issue remains for video captions. I am exploring a few different ways of resolving the issue for video captions, and I would like to present that fix in a separate PR.
Test steps
I also checked and verified that this change did not seem to mess up TalkBack or VoiceOver support.
Checklist: