Offcanvas not showing with class .show
See original GitHub issueHi all,
I’m trying to use the offcanvas opened by default but adding the class .show is not working (it is closed as default). Using these versions: https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/js/bootstrap.bundle.min.js
<div class="offcanvas offcanvas-start show" data-bs-scroll="true" tabindex="-1" id="offcanvas" data-bs-backdrop="false" aria-labelledby="offcanvasNavbarLabel" style="width:300px;">
<div class="offcanvas-header">
<a href="/">
<img src="assets/logo.png" alt="Logo">
</a>
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
</div>
</div>
Adding on the style “visibility:visible;” starts showing by default but the buttons for dismiss and toggle seems not working on the first click.
Using it inside the main navbar (exactly as the example provided on the docs).
Am I missing something? Could you help, please?
- Windows 10
- Edge latest version
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
v5 Offcanvas: Not visible on page load with show class
I'm trying out the new offcanvas component, which is great, but when I have show as part of the initial classes, the menu...
Read more >Bootstrap 5 offcanvas is not working with images or icons ...
Bootstrap 5 offcanvas is not working with images or icons inside the anchor · Go on your mobile device · Go to the...
Read more >Offcanvas
Build hidden sidebars into your project for navigation, shopping carts, and more with a few classes and our JavaScript plugin.
Read more >[Solved] Off Canvas Menu-Header Not Showing - Forums
Got issue with my off canvas responsive. When it reaches my breakpoints of 959px my menu header will not show its background?
Read more >Bootstrap 5 Offcanvas
Offcanvas. Offcanvas is similar to modals (hidden by default and shown when activated), except that is often used as a sidebar navigation menu....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks!
I managed to find windows 10 with Edge latest version. Unfortunately, I successfully opened codepen example, plus a demo of the same code , as an html file. So I do not know how to help you, without replicating it