API19+ autocorrect issues
This is a master list of issues caused by autocorrect/autocomplete in the API 19+ Chromium WebView:
- [ ] Backspace on text after a blockquote or list causes buggy autocorrect on API22+ (#367)
Apparently solved (may have missed edge cases)
- [x] Words are sometimes duplicated, the full cause is still under study (an example can be seen in the blockquote glitch video)
Solved
- [x] ~~Formatting glitches with blockquotes: https://cloudup.com/cN0k8O4nIXV~~ (ref: PR #153 Issue #159)
- [x] ~~Switching between the title and content fields doesn't work properly when in the middle of typing a word~~ (#158)
- [x] ~~Posts beginning with a word that triggers autocorrection can have the paragraph formatting broken by autocorrect~~ (issue: https://github.com/wordpress-mobile/WordPress-Editor-Android/issues/389 PR: https://github.com/wordpress-mobile/WordPress-Editor-Android/pull/390)
- [x] ~~Posts beginning with blockquotes on API23+ can have the blockquote stripped by autocorrect~~ (issue: https://github.com/wordpress-mobile/WordPress-Editor-Android/issues/385 PR: https://github.com/wordpress-mobile/WordPress-Editor-Android/pull/399)
- [x] ~~Applying a style (e.g. bold, italics) while in the middle of typing a word (with visible suggestions) does not work~~ (issue: #123 PR: #427)
These happen consistently on stock Android devices, with the default system soft keyboard.
Notes on variations:
- Hard keyboards don't use autocorrect and these issues don't affect them (could they under any circumstances?)
- Samsung apparently has their own autocorrect (on all devices?), which may change things on those devices. Testing on an API 19+ Samsung device imminent (@bummytime)
- Custom keyboards, IME, etc: WIP
Formatting glitches with blockquotes: https://cloudup.com/cN0k8O4nIXV (ref: PR #153)
Testing on a Samsung S6 (API21) and I am not seeing this behavior.
Noticing an autocorrect bug when pressing backspace on a new line with whitespace right after exiting a blockquote. (API23 Nexus 5X)
I noticed that the last word of an image caption is duplicated if you backspace up to the caption and then start typing: https://cloudup.com/c2TqFDbohIh
Tested in Nexus 9, Android 6.0.1 (API23), app v. alpha-6. Only happens when autocorrect is enabled.
Formatting glitches with blockquotes: https://cloudup.com/cN0k8O4nIXV (ref: PR #153 Issue #159)
Can't reproduce this one anymore, almost certainly fixed by the p -> div change.
Re: word duplication (bullet #3 above, and Rachel's comment about image captions), all cases seem to involve:
- Entering text in an element that's not a
div - Switching (e.g. by backspace) from a
divelement to a non-divelement
This was partially fixed in https://github.com/wordpress-mobile/WordPress-Editor-Android/pull/334, by switching from p as the paragraph separator to div (for normal paragraphs with no formatting), and with https://github.com/wordpress-mobile/WordPress-Editor-Android/pull/358 (for pasting and general blockquotes). ~~Less common cases like captions still exist, however, and have to be individually fixed.~~
One case of autocorrect glitching occurs when exiting a blockquote, typing, and backspacing after space:

The same also happens after lists.
I'm only able to reproduce the bug above on an API23 device and an API22 emulator, - API19 and 21 emulators don't exhibit the bug.
Opened a new issue for above bug and updated initial comment: https://github.com/wordpress-mobile/WordPress-Editor-Android/issues/367.
Posts beginning with blockquotes on API23+ can have the blockquote stripped by autocorrect (https://github.com/wordpress-mobile/WordPress-Editor-Android/issues/385)
This was fixed in #399, updated OP.
Words are sometimes duplicated, the full cause is still under study (an example can be seen in the blockquote glitch video)
I think all cases of this have been fixed, I haven't encountered this issue in a long while. I've updated the OP and moved it to a 'Apparently solved' group, since it's possible it might still occur in a rare edge case.
Applying a style (e.g. bold, italics) while in the middle of typing a word (with visible suggestions) does not work (#123)
This was fixed in #427, updated OP.
If you have a formatted word followed by a misspelled, unformatted word, the misspelled word will get the formatting from the previous word when it's autocorrected:
- With autocorrect enabled on your device, open the editor
- Tap the italics button to enable it, type a word and a space, and tap the italics button to disable it again
- Misspell the next word you type
- Add a space. Result: The word is autocorrected and gets the formatting from the previous word.
Reported originally on Moto g, WPAndroid alpha-16. Tested and confirmed on Nexus 9, Android 6.0.1, WPAndroid alpha-16. h/t Zandy for the report.