I am trying to use Bootstrap 5 offcanvas in a responsive design. When using mobile everything works because the offcanvas is relative to the viewport. However when using larger screens, I am using container as the main div (not container-fluid) and in this case the offcanvas shows from the edge of the viewport instead of from inside the container.
How can I force the offcanvas element to start from inside the container and not the start of the viewport?
<div class="container" style="border:1px solid grey;height:100vh">
<button class="btn btn-primary" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasExample" aria-controls="offcanvasExample"> Open menu </button>
<div class="offcanvas offcanvas-start" tabindex="-1" id="offcanvasExample" aria-labelledby="offcanvasExampleLabel">
<div class="offcanvas-header">
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<div> Menu </div>
</div>
</div>