Skip to content

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

Merged
merged 2 commits into from
Apr 28, 2025

Conversation

jomcarvajal
Copy link
Contributor

@jomcarvajal jomcarvajal commented Apr 25, 2025

CORE-675

Rename SectionNav to ButtonNav and refactor props from ToggleButtonGroup

@jomcarvajal jomcarvajal requested a review from jivey April 25, 2025 18:13
Copy link
Member

@jivey jivey left a 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?

newSet.add(firstSectionKeys[currentIndex - 1]);
scrollToIndex(firstSectionKeys[currentIndex - 1]);
newSelectedItem = flattenedSections[currentIndex - 1].id;
scrollNavToSection(flattenedSections[currentIndex - 1].id);
Copy link
Member

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;
Copy link
Member

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 ??

selectedItems={selectedItems}
onSelectionChange={setSelectedItems}
selectedItems={new Set<Key>([selectedItem])}
onSelectionChange={(newSet) => setSelectedItem([...newSet][0] as string)}
Copy link
Member

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

@jomcarvajal jomcarvajal merged commit 2984326 into main Apr 28, 2025
3 checks passed
@jomcarvajal jomcarvajal deleted the CORE-675-refator-toggle-group-props branch April 28, 2025 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants