From e23b2f3dddf3cb4d04f384a3e9c2c4badcf68715 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Thu, 10 Apr 2025 14:07:44 +0300 Subject: [PATCH] fix(mobile): bring back scrolling to toolbar --- .../ribbon_widgets/mobile_editor_toolbar.ts | 69 +++++++++---------- 1 file changed, 32 insertions(+), 37 deletions(-) diff --git a/src/public/app/widgets/ribbon_widgets/mobile_editor_toolbar.ts b/src/public/app/widgets/ribbon_widgets/mobile_editor_toolbar.ts index bb121f365..6f87de40e 100644 --- a/src/public/app/widgets/ribbon_widgets/mobile_editor_toolbar.ts +++ b/src/public/app/widgets/ribbon_widgets/mobile_editor_toolbar.ts @@ -1,54 +1,47 @@ import NoteContextAwareWidget from "../note_context_aware_widget.js"; const TPL = /*html*/`\ -
+
+
+
`; @@ -64,6 +57,7 @@ const TPL = /*html*/`\ export default class MobileEditorToolbar extends NoteContextAwareWidget { private observer: MutationObserver; + private $innerWrapper!: JQuery; constructor() { super(); @@ -76,6 +70,7 @@ export default class MobileEditorToolbar extends NoteContextAwareWidget { doRender() { this.$widget = $(TPL); + this.$innerWrapper = this.$widget.find(".classic-toolbar-widget"); this.contentSized(); // Observe when a dropdown is expanded to apply a style that allows the dropdown to be visible, since we can't have the element both visible and the toolbar scrollable. @@ -88,7 +83,7 @@ export default class MobileEditorToolbar extends NoteContextAwareWidget { #onDropdownStateChanged(e: MutationRecord[]) { const dropdownActive = e.map((e) => (e.target as any).ariaExpanded === "true").reduce((acc, e) => acc && e); - this.$widget[0].classList.toggle("dropdown-active", dropdownActive); + this.$innerWrapper.toggleClass("dropdown-active", dropdownActive); } async #shouldDisplay() {