Closed theck13 closed 7 years ago
It seems that the bug is caused by https://github.com/wordpress-mobile/WordPress-Aztec-Android/blob/5d1ca192ebdddbc9a12303fc6fbdee14fbbbb0ee/aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt#L871-L873. Our code messes up the order of some of the events emitted by the EditText ending up in a selectionChanged
event before the text-changed events. That causes the cursor to move and then the character be deleted which of course deletes the wrong character.
I also noticed this happening when I try to delete text in the title field. The cursor moves back one space and then deletes a character, so I can't fully delete the title.
Tested on Nexus 9, Android 7.1.1, WPAndroid alpha-35.
Actually, I am seeing this in both the title and content fields in the editor on my device. I can't delete text normally at all, even if the post content includes only text.
I see what Rachel sees as well - If I've written abc
in the content area and want to delete the b
I place the cursor between the b
and the c
- and the a
is deleted.
It sometimes seems to "fix" by deleting the return before the word, if it's the first word on a line. But it's inconsistent.
This is without images in the post.
Android 6.0, alpha-35.
Also seen on Pixel XL, Android 7.1.1 (latest pure Android), alpha-35. I have a video if it occurring in the title field if it is helpful.
FYI, this is fixed with #278 but note that, as of writing, that PR is not merged yet.
Fixed by #278.
Expected
The cursor remains after text when using backspace to delete text surrounding images.
Observed
The cursor jumps before text when using backspace to delete text surrounding images. Note the behavior only occurs on devices with Nougat. Testing on emulators with Nougat and devices pre-Nougat do not show this behavior.
Reproduced
Before Image
After Image
Tested
Google Pixel on Android 7.1.1 with AztecDemo 1.0