Comments (2)
this is just due to your modal code being inside of the offcanvas code, simply move your modal outside of the offcanvas code and it will work as intended.
<a class="btn btn-primary" data-bs-toggle="offcanvas" href="#offcanvasExample" role="button" aria-controls="offcanvasExample">
Open Off Canvas
</a>
<div class="offcanvas offcanvas-start" tabindex="-1" id="offcanvasExample" aria-labelledby="offcanvasExampleLabel">
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="offcanvasExampleLabel">Offcanvas</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<div>
Some text as placeholder. In real life you can have the elements you have chosen. Like, text, images, lists, etc.
</div>
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal">
Launch demo modal
</button>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="exampleModalLabel">Modal title</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
from bootstrap.
Thanks for opening this issue @yer-ly
As pointed out by @morrissey-ingenious (thanks for the quick answer), the modal should be defined outside the offcanvas to avoid that.
from bootstrap.
Related Issues (20)
- Add a Timeline component. HOT 2
- Instead of selecting in the code box, it is redirecting me to the bottom. (in the code snippet of any component) HOT 5
- Navbar only working in stackblitz demo HOT 3
- Website search bar does not work HOT 1
- Legend not formatted like an label in a vertical form HOT 2
- Attribute 'data-bs-delay' and JS not working on .toast HOT 3
- No Validation Success Icon When Using Saved Browser Data HOT 1
- Found a 'popover' attribute with an invalid value. HOT 2
- Remove unreferenced CSS variable in `bootstrap-reboot*.css` HOT 6
- Padding inconsistent in bootstrap5.3 HOT 3
- Collapse adds an automatic closing behavior
- Radio inputs break out of .form-contol containers when using floating labels HOT 7
- Alert with icons example is broken HOT 3
- Bootstrap transition are not working on my computer..
- Accordion button border color is changed on focus but its width is always 0
- Utilities: Introduce an option to generate more display utility HOT 1
- Tabindex issues on Firefox and Safari HOT 4
- Close button color cannot be changed to light mode when a parent has [data-bs-theme="dark"] HOT 1
- Navbar not clickable on Mobile when using data-bs-hover! HOT 2
- Bootstrap Modals not animated in Firefox 121 / Ubuntu 22.04.3 LTS HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bootstrap.