From cac2071dcf4d99252b8df2ecdee5ca8d585d8290 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Tue, 26 Dec 2023 22:36:59 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/9983 --- app/src/protyle/render/av/cell.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts index c5ac2e884..89e2bdc19 100644 --- a/app/src/protyle/render/av/cell.ts +++ b/app/src/protyle/render/av/cell.ts @@ -307,18 +307,16 @@ export const popTextCell = (protyle: IProtyle, cellElements: HTMLElement[], type }); }); } - if (type === "block" && blockElement) { + if (type === "block") { inputElement.addEventListener("input", (event: InputEvent) => { if (event.isComposing) { return; } - if (Constants.BLOCK_HINT_KEYS.includes(inputElement.value)) { + if (Constants.BLOCK_HINT_KEYS.includes(inputElement.value.substring(0, 2))) { protyle.toolbar.range = document.createRange(); protyle.toolbar.range.selectNodeContents(cellElements[0].lastChild); focusByRange(protyle.toolbar.range); - hintRef("", protyle, "av"); - inputElement.value = ""; - updateCellValueByInput(protyle, type, cellElements); + hintRef(inputElement.value.substring(2), protyle, "av"); avMaskElement?.remove(); event.preventDefault(); event.stopPropagation();