Followup ListView hook refactor#3127
Merged
Merged
Conversation
exports some more things from aria/grid package and adds a new hook for selection announcements
LFDanLu
commented
May 13, 2022
Comment on lines
+30
to
+37
| interface GridSelectionState<T> { | ||
| /** A collection of items in the grid. */ | ||
| collection: Collection<Node<T>>, | ||
| /** A set of items that are disabled. */ | ||
| disabledKeys: Set<Key>, | ||
| /** A selection manager to read and update multiple selection state. */ | ||
| selectionManager: SelectionManager | ||
| } |
Member
Author
There was a problem hiding this comment.
A more generalized state type than GridState since we actually provide a state of type ListState from useList. I could make this GridState<T, GridCollection<T>> but would then need to do some typescript hackiness (read: as any) in useList's call of useGridSelectionAnnouncement
LFDanLu
commented
May 13, 2022
| isVirtualized, | ||
| keyboardDelegate, | ||
| getRowText = (key) => state.collection.getItem(key)?.textValue, | ||
| getRowText, |
Member
Author
There was a problem hiding this comment.
No default provided here explicitly contrary to what the AriaListOptions state, but the default is setup in the useGridSelectionAnnouncement hook
|
Build successful! 🎉 |
snowystinger
approved these changes
May 16, 2022
Member
snowystinger
left a comment
There was a problem hiding this comment.
tested in Safari VO MacOS
devongovett
approved these changes
May 17, 2022
|
Build successful! 🎉 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses followup comments from #3086 (review)
Removes duplicated intl files in favor of exporting useHighlightSelectionDescription from
react-aria/gridand creatinguseGridSelectionAnnouncement
✅ Pull Request Checklist:
📝 Test Instructions:
Test that selections made in ListView and TableView are still properly announced. Confirmation that the highlight selection announcement will need to be done outside the storybook due to
mainlandmark element preventing announcement🧢 Your Project:
RSP