-
Notifications
You must be signed in to change notification settings - Fork 289
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
Aria attributes for selection #490
Comments
We're happy to accept a PR for this. I fear that if we go by the callback prop on the grid approach, we might be extending our basic grid with features that might not be necessary for every user. Also this will slightly complicate the design since other similar features will result in adding even more callbacks/props. Should we instead focus on having a generic callback function that FDT uses to calculate props for each row? This would probably align with the existing @wcjordan, @Tanner-MS, any thoughts? |
I was thinking of a generic callback function for any attributes you want to get added to the div that is role="row". This can be put on the rowSettings like the rowHeightGetter. |
I like the idea of a generic function which applies attributes to the row. |
So we should go with something like Additionally, for clarification, we aren't looking to replace |
Sounds good. You'll likely place it around here, passed from the bufferer component perhaps.
Yea, we'll just add the new prop. |
Added function props `gridAttributesGetter` and `rowAttributesGetter`. These functions can be used to return the grid/row HTML attributes. These will be directly passed to the DIV elements by FDT. `rowAttributesGetter` is invoked for each visible row (including buffer) with the `rowIndex` as the first param.
Summary
There should be aria attributes for when rows are selectable by adding
aria-multiselectable
to the grid andaria-selected
to selected rows.Expected Behavior
Aria attributes are rendered in the appropriate scenarios.
Current Behavior
If a grid has selectable rows, neither the grid or the rows have the correct aria attributes.
Possible Solution
There could be an additional boolean prop on the grid for indicating multiselect. There could also be another method callback prop on the grid as a way to indicate to an FDTRow that it is selected, so that the correct aria attributes are rendered. That callback prop would provide the row index and would return a boolean value of whether or not the row is selected.
Context
Screen readers need these aria attributes to properly decipher a grid and its state.
The text was updated successfully, but these errors were encountered: