valor-software / ngx-bootstrap

Fast and reliable Bootstrap widgets in Angular (supports Ivy engine)
https://valor-software.com/ngx-bootstrap
MIT License
5.53k stars 1.69k forks source link

v10 Close modal with animation on #6547

Open timscriv opened 1 year ago

timscriv commented 1 year ago

Bug description:

When closing a modal with the modalRef.hide() the behavior has changed beween v9 and v10. It no longer smoothly closes the modal. It will use the animation on the backdrop but the modal stay open until the end of animation and then instantly disappears. This can even be seen on the main site.

Plunker/StackBlitz that reproduces the issue:

Click Create template modal then press the x

v9.0.0 - https://valor-software.com/ngx-bootstrap/old/9.0.0/#/components/modals?tab=overview v10.0.0 (Broken) - https://valor-software.com/ngx-bootstrap/#/components/modals?tab=overview

Versions of ngx-bootstrap, Angular, and Bootstrap:

ngx-bootstrap: v10

Angular: v15

Bootstrap: v4

Expected behavior

To function like v9 and close the modal at the same time as the backdrop with animation.

KonkypenT commented 1 year ago

is it fixed?

MircoEnnova commented 1 year ago

I see a pull request fixing this issue.. is there any chance of someone reviewing it please?

gandeladri commented 1 year ago

any workaround or fix yet?

kkotiq commented 9 months ago

a workaround: you can remove class "show" before calling modalRef.hide(), it is not very convenient though

msamyashash commented 7 months ago

a workaround: you can remove class "show" before calling modalRef.hide(), it is not very convenient though


modalRef?: BsModalRef;
closeModal() {
    const modalElement: HTMLElement | null = document.querySelector('.modal.show');
    modalElement?.classList.remove('show');
    this.modalRef?.hide();
}