'Updating `enterKeyHint` resets the input value on Chrome Android
I'm updating the value of enterKeyHint
dynamically in an autocomplete library. When there's a active item, the Enter
key should use "go" (to hint that hitting Enter
navigates to the item's link) and when there isn't (no query, no results), the Enter
key should use "search".
This DOM updates works fine on most mobile browsers, except on Chrome Android. When the update happens, the input value is cleared.
I've reproduced the issue in isolation. The update kicks in at 5 characters.
Here are quick previews on a Galaxy S9:
With Firefox Android, the Enter
key's label updates as expected and the input value doesn't change.
With Chrome Android, the Enter
key updates but the input value is reset (causing new updates to the Enter
key, etc.)
I'm suspecting an inconsistency between how mobile browsers implement the spec, since everything works as expected on Safari iOS, Chrome iOS and Firefox Android. However, I couldn't find anything online, it doesn't seem like this behavior has been reported before (I assume updating this propery isn't too commonplace).
Has anyone ever faced this issue, or understands it? Thanks in advance!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|