Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it ok for appearance:base <select> not to require user activation before showPicker()? #10604

Open
mfreed7 opened this issue Sep 6, 2024 · 3 comments

Comments

@mfreed7
Copy link
Contributor

mfreed7 commented Sep 6, 2024

What is the issue with the HTML Standard?

As we're working on the new appearance:base-select mode for <select>, we came across a question. The "old" (appearance:auto/none) select requires user activation before calls to showPicker(), mostly (I believe) for security reasons. Since the native picker can extend beyond the bounds of the viewport, it'd dangerous to allow it to be invoked directly by JS. However, in appearance:base-select mode, the picker is always just a popover, which can't extend beyond the viewport bounds. So it would seem that showing the <select> picker is no more dangerous than allowing popover.showPopover(), since they're essentially the same thing. So our plan was to remove that restriction when the select's ::picker(select) is set to appearance:base-select. But we wanted to see if there were any other reasons not to allow that?

@pshaughn
Copy link
Contributor

pshaughn commented Sep 7, 2024

What happens if appearance changes while the picker's open?

@mfreed7
Copy link
Contributor Author

mfreed7 commented Sep 7, 2024

What happens if appearance changes while the picker's open?

That’s something that came up in discussion last week. To avoid possible oscillation or hysteresis, if the appearance property changes while the picker (auto or base-select) is open, the picker will be closed.

@annevk
Copy link
Member

annevk commented Sep 19, 2024

This would also require showPicker() to perform some kind of style resolution, which seems suboptimal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants