Unable to highlight the word the cursor is attached to (Android 5.1.1+?)
In some cases, it's not possible to highlight the word the cursor is currently attached to. This currently looks like a bug specific to Android 5.1.1 and over.
Here's a demo of the behavior on a Nexus 4 (API 22, 5.1.1):
https://cloudup.com/c4XraYk20zU
(attempting to highlight 'test' while the cursor was attached to it failed, but highlighting 'post' worked).
The bug doesn't occur on the Nvidia Shield (API 22, 5.1.0):
https://cloudup.com/cPX_Xzv-va2
(although in this case the highlight fill color doesn't appear when 'test' is highlighted, which is also buggy behavior)
Notes:
- The bug also appears on the Nexus 6 (
5.1.1) and the Nexus 9 (Android Mdeveloper preview,WebView v44.0.2403.13) - Unable to reproduce the bug on any emulator (up to
5.1.0, there is no5.1.1emulator available yet) - Does not occur on Samsung S3 (
API 18) - Doesn't seem to be
WebViewrelated (bug occurred on Nexus 4 and not on Nvidia Shield while both runningv43(43.0.2357.121) and the bug always seems to occur on the Nexus 4 no matter whichWebViewis installed) - Doesn't seem related to autocorrect (still occurs with autocorrect turned off on Nexus 4)
Another data point: this issue does not occur on the Samsung S6 (5.0.2 - API 21 & Webview v43.0.2357.121)
New data point (thanks @tonyr59h): issue occurs on the HTC One (5.1.0, WebView v39 AND 43.0.2357.121), unable to highlight with the cursor in the middle of the word (but can highlight with the cursor at the end of the word, with no highlight fill color appearing).