Skip to content

Commit

Permalink
Ensure mobile button is not covered by toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
mgmeyers committed Apr 17, 2024
1 parent 88bb1ba commit 982ddda
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
13 changes: 13 additions & 0 deletions src/components/Editor/MarkdownEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,26 @@ export function MarkdownEditor({
extensions.push(
EditorView.domEventHandlers({
focus: (evt) => {
if (Platform.isMobile) {
view.contentEl.addClass('is-mobile-editing');
}

evt.win.setTimeout(() => {
this.app.workspace.activeEditor = this.owner;
if (Platform.isMobile) {
this.app.mobileToolbar.update();
}
});
},
blur: (evt) => {
this.app.workspace.activeEditor = null;
if (Platform.isMobile) {
view.contentEl.removeClass('is-mobile-editing');
evt.win.setTimeout(() => {
this.app.mobileToolbar.update();
});
}
},
})
);

Expand Down
13 changes: 9 additions & 4 deletions src/styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ button.kanban-plugin__search-cancel-button .kanban-plugin__icon {
height: 100%;
}

.is-mobile & > div {
.view-content:not(.is-mobile-editing) & > div {
padding-bottom: calc(1rem + var(--mobile-navbar-height));
}

Expand Down Expand Up @@ -663,10 +663,15 @@ button.kanban-plugin__lane-settings-button + button.kanban-plugin__lane-settings
background-color: var(--background-secondary-alt);
flex-grow: 0;
flex-shrink: 1;
width: auto;
margin-block-start: 5px;
line-height: 1;
font-size: 14px;
height: auto;
line-height: 1;
margin-block-start: 5px;
width: auto;

.is-mobile & {
font-size: 12px;
}
}

button.kanban-plugin__new-item-button {
Expand Down
14 changes: 9 additions & 5 deletions styles.css

Large diffs are not rendered by default.

0 comments on commit 982ddda

Please sign in to comment.