[Webkit-unassigned] [Bug 225915] New: <input type="date"> should trigger selectionchange event as selection moves between parts

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 18 07:29:35 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=225915

            Bug ID: 225915
           Summary: <input type="date"> should trigger selectionchange
                    event as selection moves between parts
           Product: WebKit
           Version: Safari 14
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Forms
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: andyearnshaw at gmail.com
                CC: cdumez at apple.com, wenson_hsieh at apple.com

I'm filing this bug in the interests of parity with other browsers, namely Firefox, Chrome, Edge and Opera. In those browsers, as you press the arrow keys or tab keys in a date input, a selectionchange event triggers *if* the selection moved to another part of the date. For instance, if the format were dd/MM/yyyy and the selection was on dd, pressing ArrowRight will move to mm and trigger a selectionchange. If the input was on yyyy and the user presses ArrowRight, the selection does not change and no selectionchange event is triggers. Currently, Safari does not fire the selectionchange event at any point whilst moving between parts.

Although there's no useful information to be gained from the selection object itself (indeed, both Blink and Gecko don't provide anything when `window.getSelection()` is called), the event is useful for knowing when *nothing* happened. For our particular usecase, we have a spreadsheet-like component, you can enter a cell that has a date format and the date input appears. We want the ArrowLeft/ArrowRight keys to move to adjacent cells when on the leftmost/rightmost parts, much like Excel does but without hindering the user's ability to interact with the date input. The easiest way to do this is to move out if the key event was not immediately followed by a selectionchange event. Without the selectionchange event it likely requires hacks or is not possible in Safari at all.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210518/8a9b6b3a/attachment-0001.htm>


More information about the webkit-unassigned mailing list