NEW 218507
Up and down arrow keys in <input> have a different behavior when inside a shadow root
https://bugs.webkit.org/show_bug.cgi?id=218507
Summary Up and down arrow keys in <input> have a different behavior when inside a sha...
Cory LaViska
Reported 2020-11-03 04:31:02 PST
When an <input> is present inside a shadow root, pressing the up/down arrows no longer moves the cursor to the start/end of the field. The following fiddle demonstrates a standard input with the correct behavior and an input within a shadow root with differing behavior. Fiddle: https://jsfiddle.net/me9yatxz/1/
Attachments
Darin Adler
Comment 1 2020-11-03 12:58:38 PST
Does anyone know if this is a recent change or a long-standing issue?
Smoley
Comment 2 2020-11-04 10:39:56 PST
This also reproduces on Safari 13.1.2.
Radar WebKit Bug Importer
Comment 3 2020-11-04 10:40:17 PST
Darin Adler
Comment 4 2020-11-04 18:21:54 PST
Seems like this bug is in Safari, not WebKit.
Darin Adler
Comment 5 2020-11-04 18:42:11 PST
Safari uses JavaScript to get metadata about the text field, and when it can’t because the field is in a shadow tree, its code misfires and blocks the up and down arrows. The misbehaving code is in Safari for handling autocompletion lists. The smaller fix is to make it just not screw up and confuse itself when the text field is in a shadow tree. The bigger fix would be to make autocompletion work with those fields too.
Darin Adler
Comment 6 2020-11-05 09:28:59 PST
The test case works as expected in MiniBrowser, and likely in other WebKit-based browsers. There is a slim chance that some kind of change in WebKit could solve the problem, since it’s indirectly due to difficulty getting data about the text field from the Safari code.
Note You need to log in before you can comment on or make changes to this bug.