mirror of https://github.com/zulip/zulip.git
overlays: Don't close overlays when drawing selections.
This fixes the following bug: * Open the streams modal. * Click and hold in the word "Streams" at the top. * Move pointer up out of the modal. * Release. * Expected: Some text is selected, but nothing else happens. * Actual: The modal disappears. We use the same fix we use for this class of issue in other places: checking for whether a range is selected, and if so, doing nothing.
This commit is contained in:
parent
a307de95de
commit
081d74141b
|
@ -231,6 +231,10 @@ export function initialize() {
|
|||
$("body").on("click", "div.overlay, div.overlay .exit", (e) => {
|
||||
let $target = $(e.target);
|
||||
|
||||
if (document.getSelection().type === "Range") {
|
||||
return;
|
||||
}
|
||||
|
||||
// if the target is not the div.overlay element, search up the node tree
|
||||
// until it is found.
|
||||
if ($target.is(".exit, .exit-sign, .overlay-content, .exit span")) {
|
||||
|
|
Loading…
Reference in New Issue