mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 07:53:45 +08:00
88ec2320dc
Previously we were using 'mouseup', which meant that if you started the click inside, and then dragged to outside the modal, it would still close. This kind of dragging action is common when selecting text, and having it close the modal can be very frustrating. Simply switching to a 'click' listener doesn't totally solve the problem, because when a click event involves dragging from one element to another, the browser will fire the event on "the most specific ancestor element that contained both elements". For modals, the most specific common ancestor was still the `modal-middle-container`, which would cause the modal to close. Therefore, this commit sets the modal containers to have `pointer-events: none`, and sets up the click listener on the `.modal-backdrop` element, which is **adjacent** to the modal in the DOM. That means that click events fired on any ancestors of the modal will not accidentally trigger closure. |
||
---|---|---|
.. | ||
common | ||
desktop | ||
mobile | ||
vendor | ||
admin_rtl.scss | ||
admin.scss | ||
color_definitions.scss | ||
common.scss | ||
desktop_rtl.scss | ||
desktop.scss | ||
embed.scss | ||
ember_cli.scss | ||
mobile_rtl.scss | ||
mobile.scss | ||
publish.scss | ||
qunit-custom.scss | ||
qunit.scss | ||
wcag.scss | ||
wizard_rtl.scss | ||
wizard.scss |