wordpress-mobile / gutenberg-mobile

Mobile version of Gutenberg - native iOS and Android
GNU General Public License v2.0
244 stars 56 forks source link

Deleting Entire Word Prevents Merging Blocks #2375

Open mchowning opened 4 years ago

mchowning commented 4 years ago

Describe the bug

On Android only, when two blocks are going to be merged, deleting a swiped word at the beginning of the second block prevents them from being merge-able.

To Reproduce

1. Deleting Swiped Word

  1. Type some words into a paragraph block
  2. Move the cursor somewhere to the middle of the text and tap Enter to split the block
  3. Add a word by swiping (also test tapping) (~if you tap letters instead of swiping the bug does not occur~. It occurs with tapping out words as well, but only if you select the entire word and then hit backspace)
  4. Delete that word by pressing backspace
  5. Press backspace to merge the blocks
  6. Observe that the blocks will not merge (nothing happens when you press backspace).

backspace_merge mp4

2. Deleting Selected Word

  1. Type some words into a paragraph block
  2. Tap Enter to create a second paragraph block
  3. Type some words into the second paragraph block
  4. Delete the first word in the second paragraph block by selecting it and pressing backspace
  5. Press backspace again to merge the blocks
  6. Observe that the blocks will not merge (nothing happens when you press backspace the second time).

backspace_split_merge mp4

Expected behavior

When two paragraph blocks exist next to each other, pressing backspace at the beginning of the second paragraph block should always merge the two blocks.

Smartphone (please complete the following information):

guarani commented 4 years ago

I tested these two issues using WPAndroid 15.2.1 (I can confirm these are not present on iOS 15.3 beta).

Deleting Swiped Word issue

I could reproduce this using the Gboard keyboard. I also noticed it's not an issue on blocks that support line breaks, i.e. those where hitting backspace just merges lines, not blocks (which indicates this isn't the exact same issue as https://github.com/wordpress-mobile/gutenberg-mobile/issues/2373).

Deleting Selected Word

I could reproduce this using by typing on the Gboard. I couldn't reproduce using the Samsung keyboard. Again, it's not an issue on blocks that support line breaks.

AmandaRiu commented 3 years ago

Verified still an issue as of 1.57.0. Tested on a physical Android Pixel 4 running Android 11 w/ Gboard:

https://user-images.githubusercontent.com/5810477/125357648-e635f600-e335-11eb-9d9e-a6419ce86e0e.mp4

guarani commented 3 years ago

Confirmed this is still an issue in WPAndroid 18.2-rc-3.

illusaen commented 2 years ago

Quick update: when doing alpha writing flow tests for release 18.6 (1.65), swiping a word does still indeed break. However, it only breaks if you don't insert a space after the swiped word. If you do, it seems to recognize it fine.