Ngx-bootstrap: Modal closes on release of mouse outside modal box

Created on 11 Jun 2019  路  2Comments  路  Source: valor-software/ngx-bootstrap

I have built an example that will guide you through the odd behavior of modals:

https://stackblitz.com/edit/ngx-bootstrap-qdilhe?file=app/app.module.ts

To make it simple, If you click inside the modal, but drag and release the mouse outside the modal, the modal is dismissed nevertheless. This behavior only happens on ngx-bootstrap, not on bootstrap's modal.

comp(modal) enhancement

Most helpful comment

I took the initiative to provide a fix in a PR. It divides the click event into its mouseup and mousedown event for better handling of the cases. The only drawback is that it creates an additional event listener but to my knowledge there is no other safe way to solve this bug.

All 2 comments

Any news on this one? It's proven very irritating for my clients who select areas of text inside a modal: releasing the click outside of it closes the modal.

I took the initiative to provide a fix in a PR. It divides the click event into its mouseup and mousedown event for better handling of the cases. The only drawback is that it creates an additional event listener but to my knowledge there is no other safe way to solve this bug.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tpiros picture tpiros  路  3Comments

hugonne picture hugonne  路  3Comments

Scooviese picture Scooviese  路  3Comments

srjkrl20011991 picture srjkrl20011991  路  3Comments

pgeyman picture pgeyman  路  3Comments