Bug 218507
Summary: | Up and down arrow keys in <input> have a different behavior when inside a shadow root | ||
---|---|---|---|
Product: | WebKit | Reporter: | Cory LaViska <cory> |
Component: | Forms | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | akeerthi, cdumez, darin, rniwa, smoley, webkit-bug-importer, wenson_hsieh |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 14 | ||
Hardware: | Mac | ||
OS: | macOS 10.15 | ||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=172567 | ||
Bug Depends on: | |||
Bug Blocks: | 148695 |
Cory LaViska
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Darin Adler
Does anyone know if this is a recent change or a long-standing issue?
Smoley
This also reproduces on Safari 13.1.2.
Radar WebKit Bug Importer
<rdar://problem/71042487>
Darin Adler
Seems like this bug is in Safari, not WebKit.
Darin Adler
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
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.