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

Modal created via ModalService is not hidden after calling .hide() #3711

Closed
PascalHonegger opened this issue Feb 7, 2018 · 5 comments · Fixed by #4550 or #5861
Closed

Modal created via ModalService is not hidden after calling .hide() #3711

PascalHonegger opened this issue Feb 7, 2018 · 5 comments · Fixed by #4550 or #5861

Comments

@PascalHonegger
Copy link

Bug description or feature request:

Calling the hide() function on a modal will not hide it if it's not shown fully. This means that if I open a dialog to signal a usually long loading server call which finishes too fast (faster than the modal animation) the hide() will be called but has no effect. You can see this in my demo with three manual delays. At no or small delays the dialog just stays open, at 150ms it isn't even shown properly and at 250ms it works as expected. Another interesting behaviour is that opening many dialogs and closing them fast will leave the GUI unclickable (E.g. in my demo by clicking and holding ctrl+2).

Plunker/StackBlitz that reproduces the issue:

StackBlitz: https://stackblitz.com/edit/ngx-bootstrap-ftrzc4?file=app%2Fapp.component.ts

Versions of ngx-bootstrap, Angular, and Bootstrap:

ngx-bootstrap: 2.0.2

Angular: 4.4.6

Bootstrap: 3.3.7

Build system: Angular Starter (Webpack and SystemJS)

@PascalHonegger PascalHonegger changed the title ModalService shown modal are not hidden Modal created via ModalService is not hidden after calling .hide() Feb 8, 2018
@vizjerai
Copy link

This is still an issue with ngx-bootstrap v2.0.5 and v3.0.0

Setting the option animated: false helps but the race condition still exists.

@Roman-Simik
Copy link

Any progress, in which version will be this fixed ?

@dmitry-zhemchugov
Copy link
Contributor

@Roman-Simik Fix is now in testing
#4550

@renaldas-kerpe-arria
Copy link

Which version was this fixed in? I see the same issue in 8.x.

Looks like this issue might have been re-introduced #6195

@circlensq-hq
Copy link

circlensq-hq commented May 3, 2023

This is still an issue with ngx-bootstrap v2.0.5 and v3.0.0

Setting the option animated: false helps but the race condition still exists.

how about using bsModalService .hide() function? will it better? so we still use animation and the modal will be hidden.

Edit: I just realized, ngx-bootstrap documentation doesn't inform this function. I saw the library code, there is .hide() function inside BsModalService class.
but the version of ngx-bootstrap is different with you, mine is v7.1.2

image

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