more general solution
This commit is contained in:
parent
a28c825147
commit
b9b6e8b011
|
@ -41,7 +41,7 @@ const isIosDevice =
|
||||||
(/iP(ad|hone|od)/.test(window.navigator.platform) ||
|
(/iP(ad|hone|od)/.test(window.navigator.platform) ||
|
||||||
(window.navigator.platform === "MacIntel" &&
|
(window.navigator.platform === "MacIntel" &&
|
||||||
window.navigator.maxTouchPoints > 1));
|
window.navigator.maxTouchPoints > 1));
|
||||||
let locks = [];
|
export let locks = [];
|
||||||
let locksIndex = /* @__PURE__ */ new Map();
|
let locksIndex = /* @__PURE__ */ new Map();
|
||||||
let documentListenerAdded = false;
|
let documentListenerAdded = false;
|
||||||
let initialClientY = -1;
|
let initialClientY = -1;
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { modifier } from "ember-modifier";
|
||||||
import {
|
import {
|
||||||
disableBodyScroll,
|
disableBodyScroll,
|
||||||
enableBodyScroll,
|
enableBodyScroll,
|
||||||
|
locks,
|
||||||
} from "discourse/lib/body-scroll-lock";
|
} from "discourse/lib/body-scroll-lock";
|
||||||
|
|
||||||
@tagName("")
|
@tagName("")
|
||||||
|
@ -16,10 +17,18 @@ export default class SelectKitCollection extends Component {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isChildOfLock = locks.some((lock) =>
|
||||||
|
lock.targetElement.contains(element)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (isChildOfLock) {
|
||||||
disableBodyScroll(element);
|
disableBodyScroll(element);
|
||||||
|
}
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
|
if (isChildOfLock) {
|
||||||
enableBodyScroll(element);
|
enableBodyScroll(element);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue