You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, the Bootstrap Navbar does not close the mobile menu when clicking or tapping outside of the menu.
This should be implemented as a boolean parameter in Navbar so that developers could just turn it on. By default, the behaviour should be as the default Bootstrap Navbar works, meaning that it won't close automatically.
Since Navbar internally uses the Collapse component, the functionality should be implemented in that component, and then just reused in the Navbar component.
The text was updated successfully, but these errors were encountered:
This will require attaching an event to the <body> or <app> element and bubbling that up to the Navbar component, as well as then using @onclick:stopPropagation in the Navbar to stop it from closing itself when it's clicked on.
I did it in my personal site by using a site-wide, full-height container in MainLayout.razor and attaching the event directly to that. By doing so I was able to avoid using javascript events, and kept everything inside of Blazor. But, if we're going to handle this at the library level, there's really no alternative to using javascript. Not that I can see.
No problem in using JavaScript. That works in every browser out there, except for those very rare guys who have locked their browsers down to a point where no typical modern website can work properly.
By default, the Bootstrap Navbar does not close the mobile menu when clicking or tapping outside of the menu.
This should be implemented as a boolean parameter in
Navbar
so that developers could just turn it on. By default, the behaviour should be as the default Bootstrap Navbar works, meaning that it won't close automatically.Since Navbar internally uses the
Collapse
component, the functionality should be implemented in that component, and then just reused in theNavbar
component.The text was updated successfully, but these errors were encountered: