When you have a modal dialog that includes text which is expected to be copied with the mouse, users (inc. me) often somewhat imprecisely select the text and end up with the mouse outside of the modal dialog. They then release the mouse button used to select the text.
With ng-bootstrap modals this results in the unexpected behaviour of the whole modal gets dismissed.
I think the ideal solution would probably be to not listen for (click) in NgbModalWindow, and instead listen for (mousedown) events.
As a work-around I can disable the background click detection (option ‘backdrop’), but it would be nice to still support that.
Link to minimally-working plunker that reproduces the issue:
You can see the issue with modal
Launch the first modal, then select all of the text (‘One fine body…’) and end with the mouse just outside the modal before you release the mouse button.
Version of Angular, ng-bootstrap, and Bootstrap:
Microsoft Edge 40.15063.674.0 (Win)
Microsoft IE 11.674 (Win)
Chrome Version 61.0.3163.100 (Win)
Chrome 61.0.3163.100 (Mac)
Firefox 56.0 Mac does not exhibit the problem
Safari 11.0.1 Mac does not exhibit the problem