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

Remove eager selection of selectlist option with arrow keys #855

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lukewarlow
Copy link
Collaborator

Fixes #742

@lukewarlow lukewarlow marked this pull request as ready for review October 1, 2023 19:53
@scottaohara
Copy link
Collaborator

I agree that a change shouldn’t fire until the user has purposefully chosen an option, but with current select elements the displayed option in the triggering element does change. And that can be useful to keep.

@mfreed7
Copy link
Collaborator

mfreed7 commented Oct 5, 2023

I agree that a change shouldn’t fire until the user has purposefully chosen an option, but with current select elements the displayed option in the triggering element does change. And that can be useful to keep.

Does that typically happen for userland select menus? I feel (nothing more than a feeling) like I haven't seen that behavior anywhere but the builtin <select>. If so, perhaps we should think about what's right?

@josepharhar
Copy link
Collaborator

I agree that a change shouldn’t fire until the user has purposefully chosen an option, but with current select elements the displayed option in the triggering element does change. And that can be useful to keep.

We resolved in the issue in the commit message to not do this, right?

@lukewarlow
Copy link
Collaborator Author

I feel like the preview should show the actually selected option. If it was to change with navigation but then disappear with escape (or clickoutside) I would find that confusing personally. But like mason that's not based on anything more than intuition and not having seen it in many custom implementations.

@mfreed7
Copy link
Collaborator

mfreed7 commented Oct 16, 2023

I agree that a change shouldn’t fire until the user has purposefully chosen an option, but with current select elements the displayed option in the triggering element does change. And that can be useful to keep.

I think it's also important to point out that the above statement - that the displayed option in the triggering element does change - is a Windows-specific observation. It is not true, for example, on a Mac. For one, the popover covers the in-page element. But if you're careful, you can observe what's underneath it (e.g. via sharing your screen in a Meet, because that does not share the popover) and you can see that it does not change as you use arrow keys to change options in the popover.

Certainly a change event should not be fired until a new option is selected, however that's done.

@josepharhar
Copy link
Collaborator

Yeah I thought we basically agreed to do the mac behavior. This is what I implemented in the chromium prototype if you look in canary: https://jsfiddle.net/xhsofq2z/4/

@scottaohara
Copy link
Collaborator

I agree that a change shouldn’t fire until the user has purposefully chosen an option, but with current select elements the displayed option in the triggering element does change. And that can be useful to keep.

Does that typically happen for userland select menus? I feel (nothing more than a feeling) like I haven't seen that behavior anywhere but the builtin <select>. If so, perhaps we should think about what's right?

i'd submit you don't typically see this in most custom implementations similarly to why you don't see the ability to start typing chracters and have selection/focus move to the option that matches the typed characters - i'd submit it's an overlooked detail (which can be useful if the selected vs focused option has poor visual indicators) rather than a purposeful omission.

Regardless, I'm not going to strongly advocate that we do this. I just didn't think that the decision to not have selection follow focus had to mean this behavior was off the table too. But if people don't see the value in it, then we can move on.


Separately though, @josepharhar, i noticed in the demo you posted some oddities. rather than get into those here, i'll post a new issue

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

Successfully merging this pull request may close these issues.

<selectmenu> eagerly makes selections
4 participants