-
-
Notifications
You must be signed in to change notification settings - Fork 654
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
Rich text can be pasted into input box on Android #4660
Comments
@vaibhavs2, it looks like Wesley is specifically asking about what gets passed to |
Thanks @vaibhavs2 ! So the answer to what Which agrees with the RN docs, which say the type it passes to that callback is just Given that RN is only actually giving us the plain text, not any of the formatting, it seems like an outright bug in RN that it accepts formatting on paste and shows the formatting in the input. Though from what we saw in that chat thread linked above, it seems like Android may not give RN an easy way to fix this bug. I think the next step is to search the RN issue tracker and see if there's an existing issue. If there is, then link to it here. If there isn't, then the step after that would be to file a good bug report on RN. The key work to do to make a good bug report is that it shouldn't be about Zulip; instead it should have a simple repro, where you link to a tiny new RN app that demonstrates the bug and does nothing else. That way someone interested in fixing the RN bug can focus on that minimal repro. |
Issue Created |
As described on this CZO thread, this issue can lead to a very awkward user experience. Screen_Recording_20211023-061041_Zulip.mp4 |
For how to go about resolving this issue: At the Android level, there's a handy solution that @WesleyAC found in a Stack Overflow answer:
This works on Android >= M, which covers all the Android versions we support. Then to apply that in Zulip:
So one route to a fix would be to try the second approach, with a subclass, and then when it's working send a PR upstream to React Native to fix Alternatively, we could go straight for the upstream fix. Then there'd be a lag of a few months before we're on an RN release that has the fix. We could simply accept that lag, or we'd also have the option of switching to our own patched version of RN with the fix applied. |
The upstream issue facebook/react-native#31442 has apparently been fixed! Thanks @vaibhavs2 for filing it 🙂 |
(And from the PR thread — at facebook/react-native#38189 (comment) and facebook/react-native#38189 (review) — it's clear that our discussion here was key in getting this fixed, by making it clear why the existing behavior was a bug. So good work everyone.) |
When a user copies and pastes formatted text (for instance, from a web browser), the rich text is pasted into the compose box. This is incorrect, we should strip this formatting instead.
See this CZO thread for details.
The next step here is to look at what we get from
onChangeText
when rich text is pasted in, since that seems like the most likely route to fix this.The text was updated successfully, but these errors were encountered: