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

fix(NavbarOffcanvas): fix rendering of nav items when expand is used #6310

Merged
merged 1 commit into from
Apr 27, 2022

Conversation

kyletsang
Copy link
Member

Fixes #6309

When the navbar hits the expand breakpoint, it will render the children into a div instead of using the Offcanvas component to do it. We don't need the functionality when the nav items are shown this way anyway. One thing that needs to be done is to add a default breakpoint size for xxl in @restart/hooks.

I think this approach should be ok? Will add tests later after review.

Copy link
Collaborator

@golota60 golota60 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, left one nitpick/question

Comment on lines +54 to +74
ref={ref}
show={!!context?.expanded}
bsPrefix={bsPrefix}
backdrop={backdrop}
backdropClassName={backdropClassName}
keyboard={keyboard}
scroll={scroll}
placement={placement}
autoFocus={autoFocus}
enforceFocus={enforceFocus}
restoreFocus={restoreFocus}
restoreFocusOptions={restoreFocusOptions}
onShow={onShow}
onHide={onHide}
onEscapeKeyDown={onEscapeKeyDown}
onEnter={onEnter}
onEntering={onEntering}
onEntered={onEntered}
onExit={onExit}
onExiting={onExiting}
onExited={onExited}
Copy link
Collaborator

@golota60 golota60 Apr 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change this from {...props}? Those props are being forwarded anyway

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i mean most of these

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol yeah it's a bit ugly. I pulled it out because I also spread the remainder of the props into the div above for the navbar expand case.

@kyletsang kyletsang merged commit 63869f9 into master Apr 27, 2022
@kyletsang kyletsang deleted the fix-navbar-offcanvas branch April 27, 2022 19:16
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.

Navbar Offcanvas not showing nav items with expand prop
2 participants