Bug Fixes for Usage with Android Soft Keyboard #195
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As per this existing issue the jquery-mentions-input package does not work when trying to @mention things when using Chrome for Android (and probably any other browser on Android, though I haven't checked).
I have based my bug fix on some of the suggestions in that issue. On top of the existing issue raised regarding the keypress event on Android (which is now deprecated) no firing at all, I I also found that the soft keyboard on Android seems to return
undefined
0 or 229 (which I think is 'keyboard buffer busy) for bothe.keyCode
ande.which
meaning that much of the logic to update the inputBuffer and decide whether to undertakedoSearch()
was also failing and it was impossible to identify clicks of the del/backspace keyThis fix is still a bit of a hack, which doesn't provide any support for text edits made anywhere but the end of the textarea input (e.g. adding/updating text in the middle of the textarea won't work as expected), but seems to at least provide some support for Android