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