Bug 261743

Summary: Clicking away from date picker does not hide it when the input element is not focused
Product: WebKit Reporter: Luke Warlow <lwarlow>
Component: FormsAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: akeerthi, cdumez, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Safari 17   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=261873

Description Luke Warlow 2023-09-19 07:44:45 PDT
Load https://demo.lukewarlow.dev/showPicker/

Click the button labeled "datetime-local click". This will show the date picker UI.

Notice how the only way to close this UI is to click the input itself and then click off. I would expect at least the escape key to close it but also click away from it or the input probably should too.

Click the same button again so the datetime-local picker is open.

Now click the button labeled "date click".

Notice how the picker doesn't move to the correct location.
Comment 1 Aditya Keerthi 2023-09-20 19:33:17 PDT
Nice find! More specifically, it looks like dismissal is tied to the element being focused. Escape key to close would also be a nice enhancement, but should be a separate bug.
Comment 2 Luke Warlow 2023-09-21 05:29:38 PDT
Have opened https://bugs.webkit.org/show_bug.cgi?id=261873 to track the escape key handling for all input pickers (noticed it wasn't just date).

And yeah that's exactly what seems to be the cause it only dismisses on unfocus of the input which is an issue if it was never focused.
Comment 3 Radar WebKit Bug Importer 2023-09-26 07:45:14 PDT
<rdar://problem/116054859>