Gutenberg-mobile: Half of word is gone after text is broken into two parts in List block

Created on 20 Apr 2019  ·  2Comments  ·  Source: wordpress-mobile/gutenberg-mobile

Scenario :

Test A:

  1. Add a list block
  2. Put in a word like “hello”
  3. Place the caret in the middle of the word and tap Enter to break it
  4. Tap backspace at the beginning of the new list item to merge with above. The word merges back OK.
  5. Without moving the care, tap Enter again to break it again

Result: the second half of the word is gone
Expected: the second half of the word should be in the new line

Test B:

  1. Create a List with 3 items that have content
  2. Put the cursor on the beginning of the 3d row
  3. Press backspace
  4. Press enter

Result: the second half of the word is gone
Expected: the second half of the word should be in the new line

Blocks [OS] Android [Type] Bug

Most helpful comment

Doing some investigation and experiments, I can stop the issue from happening on my Pixel 2XL (Android 9) if I _disable all auto-text corrections and suggestions_ of the Gboard (virtual keyboard).

I think I remember similar issues back in the early Aztec days. When text correction services are in place, the EditText+VirtualKeyboard combination sends out multiple text change events, some of them only containing part of the test. If one tries to address each even individually, some events will look like parts got deleted, even though the parts re-appear in the follow up events.

In our case with Gutenberg-mobile, those intermediate events get saved in the GB state and then possibly sent back to Aztec and overriding the correct text with broken one.

All 2 comments

Doing some investigation and experiments, I can stop the issue from happening on my Pixel 2XL (Android 9) if I _disable all auto-text corrections and suggestions_ of the Gboard (virtual keyboard).

I think I remember similar issues back in the early Aztec days. When text correction services are in place, the EditText+VirtualKeyboard combination sends out multiple text change events, some of them only containing part of the test. If one tries to address each even individually, some events will look like parts got deleted, even though the parts re-appear in the follow up events.

In our case with Gutenberg-mobile, those intermediate events get saved in the GB state and then possibly sent back to Aztec and overriding the correct text with broken one.

In our case with Gutenberg-mobile, those intermediate events get saved in the GB state and then possibly sent back to Aztec and overriding the correct text with broken one.

I've been doing some tests, and those seem to confirm @hypest findings.
The GBoard sends a sequence of events (2/3 events in a row) when text correction services are in place. The last of those events does contain the correct text. Ref: https://github.com/wordpress-mobile/gutenberg-mobile/pull/850#issuecomment-482056352

Unfortunately when the Enter.Key is detected on Aztec side, only part of the text is sent to the the RN side in the payload, the part before the caret position, since the enter.key is intercepted on the first event of the series mentioned above.
Then Gutenberg-mobile processes that 1st event, and it get saved in the GB state and sent back to Aztec with the empty bullet resulting at the end of the process.

Note that the issue isn't happening in Para block, so there might even be an interaction with TextInput listeners - Aztec side - in case of lists that are not happening on Para.

Was this page helpful?
0 / 5 - 0 ratings