diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.ts index c9a960a45..e96599eaf 100644 --- a/app/src/protyle/render/av/action.ts +++ b/app/src/protyle/render/av/action.ts @@ -9,6 +9,7 @@ import {emitOpenMenu} from "../../../plugin/EventBus"; import {addCol} from "./addCol"; import {openMenuPanel} from "./openMenuPanel"; import {hintRef} from "../../hint/extend"; +import {hideElements} from "../../ui/hideElements"; export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLElement }) => { const blockElement = hasClosestBlock(event.target); @@ -131,9 +132,13 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle const addRowElement = hasClosestByClassName(event.target, "av__row--add"); if (addRowElement) { - protyle.toolbar.range = document.createRange() - protyle.toolbar.range.selectNodeContents(blockElement.querySelector(".av__title")); - hintRef("", protyle, "av"); + if (protyle.hint.element.classList.contains("fn__none")) { + protyle.toolbar.range = document.createRange(); + protyle.toolbar.range.selectNodeContents(blockElement.querySelector(".av__title")); + hintRef("", protyle, "av"); + } else { + hideElements(["hint"], protyle); + } event.preventDefault(); event.stopPropagation(); return true; diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index 4978e53f4..d13a9cf39 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -1563,7 +1563,14 @@ export class WYSIWYG { event }); }); - hideElements(["hint", "util"], protyle); + + const addRowElement = hasClosestByClassName(event.target, "av__row--add"); + if (addRowElement) { + hideElements(["util"], protyle); + } else { + hideElements(["hint", "util"], protyle); + } + const ctrlIsPressed = event.metaKey || event.ctrlKey; /// #if !MOBILE const backlinkBreadcrumbItemElement = hasClosestByClassName(event.target, "protyle-breadcrumb__item");