Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offcanvas is not dismissed, starts to stack #4669

Open
leherv opened this issue Jan 30, 2024 · 1 comment
Open

Offcanvas is not dismissed, starts to stack #4669

leherv opened this issue Jan 30, 2024 · 1 comment

Comments

@leherv
Copy link

leherv commented Jan 30, 2024

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

@mattiasgth
Copy link

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:

   this.offcanvasService.activeInstance.subscribe({
      next: (rslt: NgbOffcanvasRef) => {
        console.log(rslt);
      }
    });

The console output is:
image
When dismissing the offcanvas by clicking Close, the console output says undefined every time.

ng-bootstrap: 16.0.0
Bootstrap: 5.3.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants