Closed crookedneighbor closed 7 years ago
Which keyboard(s) does this happen with?
Wondering why it didn't occur with the keyboards we previously tested.
Samsung Keyboard.
The spooky thing is, I swear I tested this keyboard with your previous change.
🐈 :spooky: (once travis is looking 💚 )
Looks like this introduces a bug where if an input is done in the middle of an input, it puts it at the end of the input instead of in the correct place (both desktop and mobile).
🐈 :fingerscrossed:
As soon as the integration tests pass, I'll merge this.
The Travis VM was getting stuck with the Ruby binary error. The other build ran through all the integration tests without error.
Here's what was happening.
Pattern:
{{9999}} {{9999}} {{9999}} {{9999}}
In a desktop chrome, typing
1234
will automatically add a space, so the value of the input is1234
and set the selection to be after the space.In Android Chrome, on some keyboards, typing
1234
also automatically added the space, so you could inspect the value of the input and it would be1234
, but setting the selection it was as if the input was still1234
, so the selection would happen after the 4 and before the space. This would repeat when continuing to type, giving us this effect:So, for some reason, the input's value in the DOM was not being updated until after the selection was done. By setting the setSelection code in a timeout, it works.