-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Text gets lost on mobile devices #1077
Comments
I've seen a similar issue on both android and ios browsers. I'm hoping #1035 will give us the tools to fix the problem. |
+1 When I visit draftjs.org and type on my Google Pixel each word that I type disappears after I press space. |
Seems to be somewhat keyboard dependent. On the draftjs.org editor using a Google Pixel XL, Android 7.1.1, Chrome 57:
|
This bug is present on Facebook's own https://www.messenger.com (you need to select "Request Desktop site" in Chrome's menu) |
Looking deeper into this issue, it looks like Chrome with GBoard doesn't do the same thing as every other browser. There's a 5 year old issue about that on Chrome: https://bugs.chromium.org/p/chromium/issues/detail?id=118639 (marked as WontFix in 2014). Here is a codepen that appends Draft's internal state with every "onChange": http://codepen.io/anon/pen/rmwdxz Debugging a bit on a real device with it, it looks like Chrome changes the text directly inside the I think that any fix for this issue will have to look at what was added inside the element directly, instead of trying to catch every single event that could change the text. |
Doesn't reproduce on older Chromium-based browsers or on older mobile Chrome 54. In newer Chrome, there are no So, if we input "orange" with auto-correct, normally we expect:
In newer Chrome, first two are not fired. Draft.js may depend on that. With what it gets, it may decide that only whitespace was inserted, and changes Editor's contents accordingly. Working idea to solve this it to read data from |
@flarnie @pofigizm we're hearing about this bug from our Android users over at Patreon. We can reproduce on newer versions of Chrome (tapping spacebar removes text). Good to know that you're working on it. |
This duplicates the changes in pofigizm@87ccadc, which is referenced in this comment facebookarchive#1077 (comment). Until we get a response to facebookarchive#1077 (comment), this might be our best option to support our users.
I didn't work on it. |
Sup everyone, thanks for appreciating effort of @pofigizm's team.
Initially I thought that there are just a couple of things broken with You fixed this one? Well, here you are, deleting the symbols is not working. Can't blame Okay, imagine we fix that somehow. Then immediately you'll find a bug of that tapping on another word while in composition mode breaks things. Seriously, just tapping on other word. So the problem with composition on Android is big, not solveable with a couple of glorious PRs with precise fixes. Chrome mobile has changed its APIs for The file which has to be reworked into the mega-combine is [1] Just look at that beautiful log of frustration here: https://bugs.chromium.org/p/chromium/issues/detail?id=118639#c260. We're not the only ones, guys! |
Yeah, from what I have seen when I looked at it a few months ago, it looks
like an architectural issue. Draft operates by catching all keyboard events
and changing its state from that, whereas Chrome changes the DOM directly
while being quite vague on keyboard events.
Le sam. 5 août 2017 06:26, Fyodor Ananiev <[email protected]> a
écrit :
… Sup everyone, thanks for appreciating effort of @pofigizm
<https://github.com/pofigizm>'s team.
- Short answer: feel free to get some insight from the repo, but
please test it and don't trust it. There are many more issues which
immediately crop out. Some may seem to appear because of that very fix.
------------------------------
Initially I thought that there are just a couple of things broken with
composition*s on Android. It turns out, one issue immediately brings the
other to the table.
You fixed this one? Well, here you are, *deleting the symbols* is not
working. Can't blame draft-js, it's the mobile Chrome which doesn't tell
a tiny distinguishable thing about backspace key -- you have *no* clue
about the key pressed being backspace -- events have ambigous code (did I
press "a"? maybe a number? maybe it was a backspace?), no special event,
you have to guess from how DOM is changed.
Okay, imagine we fix that somehow. Then immediately you'll find a bug of
that tapping on another word while in composition mode breaks things.
Seriously, just *tapping* on other word.
So the problem with composition on Android is big, not solveable with a
couple of glorious PRs with precise fixes. Chrome mobile has changed its
APIs for mobile events a couple of times in just preceding month, working
with composition* events looks like a guessing game, and you'll have to
build a kind of guessing adapter to get even basic stability in that area.
No single fix, no fast fix, and that all should go inside 'Chrome on
Android' conditional branch in source code.
The core file which has to be reworked into the mega-combine is
src/component/handlers/composition/DraftEditorCompositionHandler.js.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1077 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA2C7gIkp309408UteB9Ds_suKLNnJMFks5sVENQgaJpZM4MfRBV>
.
|
I get the same issue using Chrome Mobile and Google Keyboard on a BLU Vivo 5. And yes as @tedmx said, many things trigger it so to would be crazy to fix one by one. For what I was able to test: space key, |
…char clears the input)
…char clears the input)
@ashevtcov has a PR fixing this issue, would be nice to have code review and get more support there. |
…char clears the input)
…char clears the input)
@tedmx any update on this issue? @fabiomcosta were you able to get your pull request merged? |
@maxhartshorn that's not my PR, but it says it's not merged yet. |
I also encountered this problem. Is it possible to come up with a solution? |
@maxhartshorn Although I already have a huge recommendation to core Draft.js developers: please be flexible — fully parametrize logic from While Draft.js is thinking about this, end-developers may fork Draft.js and themselves do that kind of parametrization. Everyone: when writing custom handler, be prepared for tons of work — this stuff gonna be hard. #1500 looks like 1/20th of work which must be done. Idea: start with hard copy of current |
Has this been fixed? I'm still seeing issues. |
@julianguyen No, unfortunately. It's well over a year on, and nothing seems to have been done here. If it's never going to be actioned, it'd be great if FB made it a tad more obvious that this doesn't work... |
Merging this into a general Android bug issue - see #1895 |
Space bar erases previous input in Android Desktop versions of Twitter et Facebook |
I'm also facing the same issue in 2021 in android. Whenever I try to send a text without space at the end of line it cuts the last word and I also can't send simple "hi", it changes the word into an empty string |
Having the same issue with @shamimfahad any update or hacky trick to fix this? |
having the same problem, anyone know how to get around this? |
try adding a space at the end of the string if there isn't any before you save it |
I've used draft-js form and got a feedback from some users, that on mobile devices wrotten text disappears.
Couldnt reproduce it by myself, but however bug appears.
The text was updated successfully, but these errors were encountered: