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

[select] what should happen on key invocations when open state is true/false #161

Open
gregwhitworth opened this issue Aug 19, 2020 · 4 comments
Labels

Comments

@gregwhitworth
Copy link
Member

Seems like two separate questions here:

  1. On Mac, do browsers receive the same KeyDown event from fn+arrow that they would get from a "real" Home/End key? When I still had the macbook I tested here and found that this appears to be true, at least as far as key events are concerned. If the browser gets the same thing for fn+arrow as it does for "real" Home/End keys, then OpenUI shouldn't need to care about any distinction here; it can just refer to Home/End everywhere.
  2. What is the right behavior for key events received by the button part when the <select> is closed, given that there are differences between browsers and OS's?

For (1), unless we have evidence that fn+arrow sends something other than Home/End to the browser, I think we should resolve that OpenUI should always just use Home/End, and close this issue.

Question (2) seems like its own investigation, outside the scope of the lack of Home/End keys on Mac, that is worth opening a new Issue to track; I agree with @gregwhitworth that this likely needs further research.

Originally posted by @dandclark in #159 (comment)

@gregwhitworth
Copy link
Member Author

This will need more research across UAs and component libs to determine if the events currently defined in the select remain true when the select is both open and closed. This was identified when we found a difference between UAs on different OSes with the home/end keys.

@chrisdholt
Copy link
Collaborator

@gregwhitworth traditionally, if I were focused on a button (or other non-select control) and used home/end I would expect to be jumped to the beginning or end of the page as that's the current behavior. As it pertains to select here, I agree that some research is needed to determine what currently happens.

It seems like there is technically a delta in this behavior right now with arrow keys when focused on a native select (example below is Edge). When not focused on select, arrow keys move the page up and down. When focused on a select it opens the popup and changes the selected item. When not focused on a select, home and end move to the top and bottom of the page. When focused on a select, this behavior persists. When the select is open, home/end moves focus between the first and last item.

@una
Copy link
Collaborator

una commented Aug 26, 2020

There are definitely different events based on state. Rob Dodson has a great video on this concept of "roving focus". I think a table of interaction would be great

@github-actions
Copy link

There hasn't been any discussion on this issue for a while, so we're marking it as stale. If you choose to kick off the discussion again, we'll remove the 'stale' label.

@github-actions github-actions bot added the stale label Mar 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants