FIX: remove redundant body scroll lock (#29395)

PR #26784 adds the scroll lock in the modal which renders this second scroll lock for SK component redundant. Having it there in fact causes issues on iPads, where it isn't necessary.
This commit is contained in:
Penar Musaraj 2024-10-24 13:41:08 -04:00 committed by GitHub
parent d80dcaa261
commit 9b1c6f8384
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 40 deletions

View File

@ -1,11 +1,5 @@
{{#if this.collection.content.length}}
<ul
class="select-kit-collection"
aria-live="polite"
role="menu"
{{did-insert this.lock}}
{{will-destroy this.unlock}}
>
<ul class="select-kit-collection" aria-live="polite" role="menu">
{{#each this.collection.content as |item index|}}
{{component
(component-for-row this.collection.identifier item this.selectKit)

View File

@ -1,31 +1,5 @@
import { cached } from "@glimmer/tracking";
import Component from "@ember/component";
import { action } from "@ember/object";
import { tagName } from "@ember-decorators/component";
import {
disableBodyScroll,
enableBodyScroll,
} from "discourse/lib/body-scroll-lock";
@tagName("")
export default class SelectKitCollection extends Component {
@cached
get inModal() {
const element = this.selectKit.mainElement();
return element.closest(".d-modal");
}
@action
lock(element) {
if (!this.inModal) {
return;
}
disableBodyScroll(element);
}
@action
unlock(element) {
enableBodyScroll(element);
}
}
export default class SelectKitCollection extends Component {}

View File

@ -1,3 +1,9 @@
.d-modal.add-pm-participants {
.d-modal__body {
overflow-y: visible;
}
}
.add-pm-participants.modal .share.modal-panel {
.header {
display: flex;

View File

@ -19,12 +19,6 @@
}
}
.d-modal.add-pm-participants {
.d-modal__body {
overflow: visible;
}
}
.d-modal.bookmark-reminder-modal {
.d-modal__container {
min-height: calc(var(--composer-vh, var(--1dvh)) * 85);