Re: [w3ctag/design-reviews] HTMLInputElement showPicker() (Issue #688)

> Since programmatic clicks already trigger the picker on color and file inputs, why not just specify that programmatic clicks trigger the picker on all inputs and avoid the additional API surface?

That's one direction we could go in, but I worry that it's a bit unexpected. click() rarely has these sorts of side effects, and the fact that it does so on file and color feels like a legacy quirk instead of something we want to extend. There's also a minor compat risk that people are calling click() and expecting no-op behavior today... although I doubt it'd be that risky.

I think the main argument is one I allude to in https://github.com/whatwg/html/issues/3232, which is that by not tying pickers to clicks, we allow a broader possible range of browser UIs for form controls, both now and in the future. Which has always felt important to me, given how we've seen things evolve with smartphones and watches and so on.

> I'm a little concerned that the name showPicker may be overly constraining. Can all UIs we may want this to trigger be described as pickers, not just now but also in the future?

I think we're kind of defining "all UIs we may this to trigger" to be pickers. That is, `showPicker()` implies you want to show a picker... if we had some other sort of UI for entering values (e.g.... a virtual keyboard??) then probably the developer doesn't want that to happen when they call `el.showPicker()`.

Perhaps another way of phrasing this is, are there other non-picker UIs that developers might want to show, in the same situations they want to show pickers? And would it be better for developers to not have to know the difference, but instead just trigger any such UIs? It's hard to say without examples, but I lean toward "picker" being a well-understood paradigm, and believing that it'll extend in the future to other non-pickers might be hard for developers to reason about...

> Doesn't this leak information about whether the user has interacted with the page, that silently doing nothing does not?

No; this information is already available in plenty of ways, e.g. by using explicit event listeners for the [activation triggering input events](https://html.spec.whatwg.org/#activation-triggering-input-event).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/688#issuecomment-964501193

Received on Tuesday, 9 November 2021 20:15:34 UTC