mirror of
https://github.com/discourse/discourse.git
synced 2024-12-15 20:53:40 +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. |
||
---|---|---|
.. | ||
admin | ||
base | ||
components | ||
foundation | ||
modal | ||
select-kit | ||
d-editor.scss | ||
font-variables.scss | ||
input_tip.scss | ||
loading-slider.scss | ||
printer-friendly.scss | ||
software-update-prompt.scss | ||
topic-entrance.scss | ||
topic-timeline.scss | ||
whcm.scss |