Open kuhlschrank opened 6 years ago
Can someone at least tell me if I am correct in assuming that the behaviour I suggested is correct? Should the dialog stay open if a click was made outside the dialog's parent?
If so, I will gladly give it a try to implement my change and submit a PR!
I'm submitting a ... [x] bug report [ ] feature request [ ] question about the decisions made in the repository
Do you want to request a feature or report a bug?
Bug - I think
inElement-dialog is dismissed when clicking anywhere on the document - not just when clicking the backdrop
http://plnkr.co/edit/aMP3kmyEK4AwnOacrIyr?p=preview
In this plunker:
Dialog of top div should not be dismissed
We need multiple dialogs in multiple divs open at the same time
Please tell us about your environment:
Angular version: 5.1.2
ngx-modialog: 5.0.0
bootstrap: 3.3.7
Browser: Chrome
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)
I found that the click listener for the backdrop dismissal is registered on the document itself
https://github.com/shlomiassaf/ngx-modialog/blob/master/src/ngx-modialog/src/overlay/overlay.component.ts#L182
this might be correct - but inside the registered handler it is never checked if the path of the click event contains the backdrop of the current dialog.
I think the backdrop should be dismissed only when the click was within the boundaries of the backdrop