From ed40c8bfd0d40b34a99efdf130da56559d644ec8 Mon Sep 17 00:00:00 2001 From: Jan Cernik <66427541+jancernik@users.noreply.github.com> Date: Thu, 24 Oct 2024 10:18:51 -0300 Subject: [PATCH] FIX: Remove scroll events for mobile modals (#29391) * FIX: Remove scroll events for mobile modals This causes some issues with different devices. We want to test the side effects of removing this. --- .../discourse/app/components/d-modal.gjs | 18 ------------------ 1 file changed, 18 deletions(-) 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;