Skip to content
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

Pressing backspace after styling all text in paragraph deletes text #2638

Closed
mchowning opened this issue Sep 17, 2020 · 3 comments
Closed

Pressing backspace after styling all text in paragraph deletes text #2638

mchowning opened this issue Sep 17, 2020 · 3 comments

Comments

@mchowning
Copy link
Contributor

mchowning commented Sep 17, 2020

Describe the bug
On Android only, the cursor is placed at the beginning of a paragraph block after styling all the text in the block, and pressing backspace at that point will delete all the text in the paragraph.

To Reproduce
Steps to reproduce the behavior:

  1. Create a paragraph block
  2. Type some text in the paragraph block, highlight all the text, and apply (or remove) styling (i.e., bold or unbold) to all the text in the block
  3. Observe that the text is now styled and the cursor is at the beginning of the paragraph block
  4. Tap the backspace key
  5. Observe that all the text is removed from the block.

Expected behavior
Pressing backspace at the beginning of a block should not delete any text in the block and instead should either do nothing (if it is the first block in the post) or merge the current block into the previous block.

Screenshots

Smartphone (please complete the following information):

  • Device: Pixel 3, Pixel 1
  • OS: Android X
  • Version: recreated on both alpha-244 and the (more recent) 4559ca2 commit

Additional context
Thanks to @khaykov for reporting this! 🙇

@hypest
Copy link
Contributor

hypest commented Sep 18, 2020

Issue is present in older editor versions as well. I tried v13.9 (January 2020) and it's there, but I'm sure it must be older anyway.

Looks like it only happens if you leave the caret at the where the "bolding" action puts it after applied (puts it at the start of the enbolden text). If you move the caret before hitting "backspace" the issue doesn't occur.

I think the "Medium" priority is fair for this one as it happens after some not-so-typical writing flow actions.

@guarani
Copy link
Contributor

guarani commented Sep 16, 2021

I couldn't reproduce this on WPAndroid 18.2-rc-3 and I tried using both the Gboard and the Samsung keyboards.

the cursor is placed at the beginning of a paragraph block after styling all the text in the block

I don't see the cursor being placed at the beginning of the paragraph block when I style all the text in the block.

Looks like it only happens if you leave the caret at the where the "bolding" action puts it after applied (puts it at the start of the enbolden text). If you move the caret before hitting "backspace" the issue doesn't occur.

This implies that the bug only occurred if the cursor is manually positioned after applying styling. In my tests today, that's required because styling leaves selection handles in place, so I must manually remove selection by tapping at the first text position to place the cursor there. This implies that the bug only occurred if the cursor is left in place after applying styling. In my tests today, I needed to manually position the cursor because styling leaves selection handles in place, so I must manually remove selection by tapping at the first text position to place the cursor there. From there, tapping backspace doesn't cause text to be deleted. From there, tapping backspace doesn't cause text to be deleted.

Here's a video of what I see:

Screen_Recording_20210916-163911_WordPress.mp4

If others can confirm this is no longer reproducible, I think we could close this.

@mchowning
Copy link
Contributor Author

I'm seeing the same thing as you Paul. Thanks for testing this and seeing that we can close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants