Skip to content

A platform for community discussion. Free, open, simple.

FIX: Remove scroll events for mobile modals (#29391)

Jan Cerniked40c8bfd0d4
diff --git a/app/assets/javascripts/discourse/app/components/d-modal.gjs b/app/assets/javascripts/discourse/app/components/d-modal.gjs
index 3956a7991a7..e9e1dab6dc4 100644
--- a/app/assets/javascripts/discourse/app/components/d-modal.gjs
+++ b/app/assets/javascripts/discourse/app/components/d-modal.gjs
@@ -19,7 +19,6 @@ import {
import { getMaxAnimationTimeMs } from "discourse/lib/swipe-events";
import swipe from "discourse/modifiers/swipe";
import trapTab from "discourse/modifiers/trap-tab";
-import { bind } from "discourse-common/utils/decorators";
export const CLOSE_INITIATED_BY_BUTTON = "initiatedByCloseButton";
export const CLOSE_INITIATED_BY_ESC = "initiatedByESC";
@@ -60,11 +59,6 @@ export default class DModal extends Component {
this.handleDocumentKeydown
);
- this.appEvents.on(
- "keyboard-visibility-change",
- this.handleKeyboardVisibilityChange
- );
-
if (this.site.mobileView) {
this.animating = true;
@@ -89,11 +83,6 @@ export default class DModal extends Component {
"keydown",
this.handleDocumentKeydown
);
-
- this.appEvents.off(
- "keyboard-visibility-change",
- this.handleKeyboardVisibilityChange
- );
}
get dismissable() {
@@ -220,13 +209,6 @@ export default class DModal extends Component {
return element(tagName);
}
- @bind
- handleKeyboardVisibilityChange(visible) {
- if (visible) {
- window.scrollTo(0, 0);
- }
- }
-
#animateBackdropOpacity(position) {
const backdrop = this.wrapperElement.nextElementSibling;