mobile fixes
This commit is contained in:
@@ -1059,10 +1059,15 @@ export function startNoteEditor(adapter) {
|
||||
if (!event.matches) setHeaderMenuOpen(false);
|
||||
});
|
||||
const mobileEditorOptions = document.querySelector("#mobile-editor-options");
|
||||
const markdownMore = document.querySelector(".markdown-more");
|
||||
const mobileToolbarQuery = matchMedia("(max-width: 720px)");
|
||||
document.addEventListener("pointerdown", event => {
|
||||
if (mobileEditorOptions?.open && !event.target.closest("#mobile-editor-options")) {
|
||||
mobileEditorOptions.open = false;
|
||||
}
|
||||
if (mobileToolbarQuery.matches && markdownMore?.open && !markdownMore.contains(event.target)) {
|
||||
markdownMore.open = false;
|
||||
}
|
||||
}, { passive: true });
|
||||
document.addEventListener("keydown", event => {
|
||||
if (event.key === "Escape" && mobileEditorOptions?.open) mobileEditorOptions.open = false;
|
||||
|
||||
Reference in New Issue
Block a user