-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Backdrop not being removed after hiding Modal #853
Comments
+1: sometimes, when I close the modal programmatically, the backdrop remains visible and I'm not able to manually close it |
This issue is bugging my app as well. Using the latest ng2 router, when I route away from the modal the bs-modal-backdrop element remains in the DOM. This can be worked around by always suppressing the backdrop using the config option. But the bigger problem is the element retains a class "modal-open" which uses overflow css to hide the scroll bars regardless of content length. It also separately leaves padding-right css on the element. |
+1 on this. |
I am having this issue when the user navigates to a different route while a modal is open. My workaround is to put the following code in the parent component that contains the dialog:
|
I have a custom component that shows a Modal after clicking a button. Within the Modal body, the user user is presented a anchor link that routes the user away from the current view. When the user does so, the Modal is hidden/destroyed but the Backdrop is not.
After reading through the code, I suspect that the problem is caused by the
SetTimeout()
when animation is in effect. Most likely, the objects are being destroyed before theSetTimeout()
call happens and therefore no references are valid and the backdropDOM
element is left in theDOM
.Ideally, it would be great if within our custom component we can either change the
isAnimate
property so it propagates down to thebackdrop.instance.isAnimated
variable or the ability to callhide()
while specifying if animation should be used for that particular call. The idea is that when showing the Modal I want to fade it onto the screen. Same for hiding the Modal when the user hits escape or clicks the backdrop. But when navigating away from the current view, I just want it all to immediately go away.The only current option is to not show the backdrop via the
config
.The text was updated successfully, but these errors were encountered: