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

HTMLSelectElement showPicker() #900

Open
1 task done
lukewarlow opened this issue Sep 20, 2023 · 11 comments
Open
1 task done

HTMLSelectElement showPicker() #900

lukewarlow opened this issue Sep 20, 2023 · 11 comments
Assignees
Labels
a11y-tracker Group bringing to attention of a11y, or tracked by the a11y Group but not needing response. Progress: pending external feedback The TAG is waiting on response to comments/questions asked by the TAG during the review Venue: WHATWG

Comments

@lukewarlow
Copy link

lukewarlow commented Sep 20, 2023

こんにちは TAG-さん!

I'm requesting a TAG review of the showPicker() method for HTMLSelectElement.

The showPicker() element is a new addition to HTMLSelectElement which addresses a common request from web developers: programmatically showing the options picker for select controls.

Further details:

  • I have reviewed the TAG's Web Platform Design Principles
  • Relevant time constraints or deadlines: None
  • The group where the work on this specification is currently being done: WHATWG
  • The group where standardization of this work is intended to be done (if current group is a community group or other incubation venue): N/A
  • Major unresolved issues with or opposition to this specification: Can showPicker() focus a control? whatwg/html#9757
  • This work is being funded by:

You should also know that...

#688 is the relevant review request for the input element. It was closed as unsatisfied because there's no way to detect if the method does anything. While the spec doesn't mandate this do anything for all implementations have a picker and therefore it will so hopefully that problem doesn't matter for this request. We'd prefer the TAG provide feedback as (please delete all but the desired option): 💬 leave review feedback as a comment in this issue and @-notify @lukewarlow

@LeaVerou
Copy link
Member

Hey, thanks for submitting this. Vast array of developer use cases, so this is exciting. Main issue I see is lack of multi stakeholder support. Have standards positions been requested from WebKIt and Mozilla? If so, could you please link to them?

Also, Chromestatus URL seems to be private?

image

@miketaylr
Copy link

Also, Chromestatus URL seems to be private?

Seems like just a mis-pasted URL. Try https://chromestatus.com/feature/5111537299881984

@lukewarlow
Copy link
Author

Apologies have corrected that. Will also file standards positions now

@LeaVerou
Copy link
Member

LeaVerou commented Oct 2, 2023

Removing "fast track?" as @cynthia had some concerns about a11y. @cynthia could you please elaborate here?

@lukewarlow
Copy link
Author

Just to keep Tag in the loop I've filed an intent to ship. https://groups.google.com/a/chromium.org/g/blink-dev/c/qew_ILTXWSY/m/AxHrcWzuAQAJ Obviously if any major concerns arise I'll address where possible before shipping.

@cynthia
Copy link
Member

cynthia commented Oct 2, 2023

So if I understand the proposal correctly, calling showPicker() would show the picker (which presumably would change the accessibility tree, since the picker is expanded now) but not necessarily move the focus. Has this been tested with a screen reader for usability?

Concern is that from a content author perspective the expansion of the picker would imply that the user is able to enumerate the choices (visually), but that assumption may not hold when the user depends on AT.

@lukewarlow
Copy link
Author

lukewarlow commented Oct 2, 2023

I have tested on macOS with Voice Over and it seems to behave as I would expect. You can focus the button when you press enter it moves focus to the first item in the select picker selecting an option returns focus to the button you're on. (or Ctrl + Option + Space moves focus to the menu arrow keys correctly navigate and it otherwise works like enter)

I don't have access to other desktop platforms to test but https://select-show-picker.glitch.me/ can be used in Chrome Canary (experimental flag on) to test it.

As for the correct aria markup for the button I am not sure but the same issue would arise with the existing input.showPicker(). https://github.com/keithamus/invoker-buttons-proposal should help with the declarative aspect of this.

@LeaVerou
Copy link
Member

LeaVerou commented Oct 2, 2023

Concern is that from a content author perspective the expansion of the picker would imply that the user is able to enumerate the choices (visually)

Not necessarily, the <select> element may be scrolled out of the viewport, so a sighted user wouldn't notice either.

Not sure if focusing the control first would preclude this from satisfying any of its use cases, but since input.showPicker() does not focus the control first either, it would definitely make it inconsistent, which I think is worse.

Actually, it would be good to have a list of use cases for both. The explainer for this does not list any use cases, and neither did the TAG review for input.showPicker(), which makes it hard to weigh the different tradeoffs.

@lukewarlow
Copy link
Author

Based on whatwg/html#9757 the spec may explicitly allow focusing the target element where required but the default would be to not focus the input (or select).

I don't think the select method would add any new confusion beyond that which might exist for the input method.

@lukewarlow
Copy link
Author

whatwg/html#7957 includes an example use case for this function.

@torgo torgo added this to the 2023-10-16-week milestone Oct 11, 2023
@torgo torgo added the a11y-tracker Group bringing to attention of a11y, or tracked by the a11y Group but not needing response. label Dec 20, 2023
@matatk
Copy link

matatk commented Jan 12, 2024

Hi @lukewarlow. Thank you for your patience.

We feel that consistency is the top priority here: if select.showPicker() and input.showPicker() do not behave consistently, this could create worse accessibility issues, not to mention DX.

We note there's ongoing discussion in whatwg/html#9757 as to if the control, or picker, should be focused by default, which perhaps indicates that the behavior of input.showPicker() can still be changed?

It's important to have a clear idea of the expected use cases. Are there any use cases that require the control/picker to not be focused?

How easy the default behavior is to escape is also a factor. If the picker is focused by default, can authors get the alternate behavior by running input.blur()? If the picker is not followed by default, can authors get the other behavior by running input.focus()?

We suggest that you talk with the Accessible Platform Architectures (APA) WG to arrive at some guidance for authors that could be incorporated into the spec as a note.

Looking forward to your response, especially around use cases.

@cynthia cynthia removed their assignment Jan 23, 2024
@LeaVerou LeaVerou added the Progress: pending external feedback The TAG is waiting on response to comments/questions asked by the TAG during the review label Jan 23, 2024
@plinss plinss removed this from the 2024-01-23-f2f-London milestone Mar 11, 2024
@torgo torgo added this to the 2024-04-22-week:a milestone Apr 21, 2024
@plinss plinss removed this from the 2024-04-22-week:a milestone Apr 29, 2024
@torgo torgo added this to the 2024-05-20-week:a milestone May 19, 2024
@plinss plinss removed this from the 2024-05-20-week:a milestone May 27, 2024
@torgo torgo added this to the 2024-06-10-week milestone Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y-tracker Group bringing to attention of a11y, or tracked by the a11y Group but not needing response. Progress: pending external feedback The TAG is waiting on response to comments/questions asked by the TAG during the review Venue: WHATWG
Projects
None yet
Development

No branches or pull requests

7 participants