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() {