-
Notifications
You must be signed in to change notification settings - Fork 1
CORE-675: rename SectionNav to ButtonNav and refactor props from ToggleButtonGroup #85
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we are updating this component, can you add user-select: none;
to the button styles so the cursor doesn't change when hovering over the button text?
src/components/ButtonNav.stories.tsx
Outdated
newSet.add(firstSectionKeys[currentIndex - 1]); | ||
scrollToIndex(firstSectionKeys[currentIndex - 1]); | ||
newSelectedItem = flattenedSections[currentIndex - 1].id; | ||
scrollNavToSection(flattenedSections[currentIndex - 1].id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use newSelectedItem
here
selectedItems: Set<Key>; | ||
onSelectionChange?: React.Dispatch<React.SetStateAction<Set<Key>>>; | ||
selectedItems: Iterable<Key> | undefined; | ||
onSelectionChange?: ((keys: Set<Key>) => void) | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this already get typed as undefined because of the ?
?
src/components/ButtonNav.stories.tsx
Outdated
selectedItems={selectedItems} | ||
onSelectionChange={setSelectedItems} | ||
selectedItems={new Set<Key>([selectedItem])} | ||
onSelectionChange={(newSet) => setSelectedItem([...newSet][0] as string)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be an empty set right? Unselecting an item will throw an error
CORE-675
Rename SectionNav to ButtonNav and refactor props from ToggleButtonGroup