Bug 234009 - Add showPicker() to <input> elements
Summary: Add showPicker() to <input> elements
Status: RESOLVED DUPLICATE of bug 237192
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-12-08 08:09 PST by beaufort.francois
Modified: 2022-06-08 03:22 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description beaufort.francois 2021-12-08 08:09:56 PST
The showPicker() method is a new addition to HTMLInputElement which addresses a very common request from web developers: programmatically showing a picker for controls like date etc.

<input id="dateInput" type="date">
<button onclick="dateInput.showPicker()">Show the date picker</button>

WHATWG Spec PR: https://github.com/whatwg/html/pull/7319
Comment 1 Radar WebKit Bug Importer 2021-12-09 13:14:07 PST
<rdar://problem/86287452>
Comment 2 zsun 2022-03-24 02:31:14 PDT

*** This bug has been marked as a duplicate of bug 237192 ***
Comment 3 zsun 2022-03-24 02:52:53 PDT
bug 237192 probably only covers part of this feature.
Comment 4 Sam Sneddon [:gsnedders] 2022-06-06 07:00:02 PDT
(In reply to zsun from comment #3)
> bug 237192 probably only covers part of this feature.

What part did it cover, and what part didn't it cover? It's not clear from either bug what has been implemented.
Comment 5 zsun 2022-06-06 09:08:43 PDT
(In reply to Sam Sneddon [:gsnedders] from comment #4)
> (In reply to zsun from comment #3)
> > bug 237192 probably only covers part of this feature.
> 
> What part did it cover, and what part didn't it cover? It's not clear from
> either bug what has been implemented.

The work on showPicker were motivated by three WPT tests show-picker-disabled-readonly.html, show-picker-user-gesture.html and show-picker-cross-origin-iframe.html. Just checked wpt.fyi, apart from show-picker-disabled-readonly.html, the other two tests pass for Safari now. For show-picker-disabled-readonly.html, basically it should throw for input that is readonly/disable. We have this part function in place. However, readonly should only applies to text only input types + <textarea>. In WebKit we need to follow specs and restrict the readonly attribute to the listed types. This is the part we need to do (see bug https://bugs.webkit.org/show_bug.cgi?id=240343).
Comment 6 Tim Nguyen (:ntim) 2022-06-08 03:21:13 PDT
I think it's reasonable to make this bug a duplicate and track remaining work in subsequent bugs.

*** This bug has been marked as a duplicate of bug 237192 ***
Comment 7 Tim Nguyen (:ntim) 2022-06-08 03:22:29 PDT
I've put followups as a dependency of bug 237192