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

Treegrid Example: getFocusableElements() does not support including <select> elements in cells #2740

Open
stephanieleary opened this issue Jun 29, 2023 · 2 comments · May be fixed by #2741
Open
Labels
Example Page Related to a page containing an example implementation of a pattern Feedback Issue raised by or for collecting input from people outside APG task force

Comments

@stephanieleary
Copy link

In the Treegrid pattern examples, there is a function called getFocusableElements() that is used to find interactive child elements of a selected row and toggle their tabindex values. The function specifies which elements should be focusable, noting that <textarea> has been left out deliberately:

root.querySelectorAll('a,button,input,td>[tabindex]');

The list should include the <select> element as well.

stephanieleary added a commit to stephanieleary/aria-practices that referenced this issue Jun 29, 2023
Adds `select` to the list of elements that should be able to receive focus in a treegrid row.

Fixes w3c#2740.
@mcking65
Copy link
Contributor

mcking65 commented Jul 2, 2023

@stephanieleary

I commented in the PR.

Like textarea, select consumes arrow keys. So, I think that including select along with button and link is probably going to break the treegrid navigation if a select element is included in a cell.

Note, I'm guessing based on reading the code, and in the PR, I described what I think the code needs to do if you want to extend the example to enable the treegrid to include select elements.

@mcking65 mcking65 added Example Page Related to a page containing an example implementation of a pattern Feedback Issue raised by or for collecting input from people outside APG task force labels Jul 2, 2023
@mcking65 mcking65 changed the title Treegrid getFocusableElements() skips <select> elements Treegrid Example: getFocusableElements() does not support including <select> elements in cells Jul 2, 2023
@jongund
Copy link
Contributor

jongund commented Jul 12, 2023

@mcking65
I creating a testing branch the includes both a text input and a select element in each row.
treegrid testing example with select and input in each row

It seems the tab behavior is the same for input and select in the treegrid, but the tab description in the example page is not accurate of the actual behavior of the example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Example Page Related to a page containing an example implementation of a pattern Feedback Issue raised by or for collecting input from people outside APG task force
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants