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
When hooking this function to a button that can be clicked multiple times the offcanvas is only closed and opened correctly once. After that the offcanvas elements start stacking over each other:
Same issue here, seems like the offcanvas gets dismissed every other time, instead of every time (as I would expect). When listening for changes like this:
We could decide that open() does nothing if there's already an active offcanvas. I think it's better than trying to queue the opening requests, and it would at least avoid stacking bugs. And it's probably better than closing the active offcanvas implicitly.
But that wouldn't really sole your case. If you want to close the active one and then immediately open a new one, you could use code such as the following one:
Bug description:
When hooking this function to a button that can be clicked multiple times the offcanvas is only closed and opened correctly once. After that the offcanvas elements start stacking over each other:
closeThenOpenDrawer() { this.offcanvasService.dismiss(); this.offcanvasService.open(OffcanvasDrawerComponent, { backdrop: false, position: 'bottom' }) }
Link to minimally-working StackBlitz that reproduces the issue:
https://stackblitz.com/edit/angular-bvjb8m-wqdm2w?file=src%2Fapp%2Foffcanvas-component.ts
Versions of Angular, ng-bootstrap and Bootstrap:
I used your Stackblitz example
Angular: 17.09
ng-bootstrap: 16.0.0
Bootstrap: 5.3.2
The text was updated successfully, but these errors were encountered: