Vanessa 2026-02-25 15:31:35 +08:00
parent 7c07f531a3
commit cab8ea3a5d
3 changed files with 3 additions and 3 deletions

View file

@ -103,7 +103,7 @@ export const genTabHeaderHTML = (data: IAV, showSearch: boolean, editable: boole
<svg><use xlink:href="#iconSearch"></use></svg>
</button>
<div style="position: relative" class="fn__flex">
<div contenteditable="true" style="${showSearch ? "width:128px" : "width:0;padding-left: 0;padding-right: 0;"}" data-type="av-search" class="b3-text-field b3-text-field--text" placeholder="${window.siyuan.languages.search}"></div>
<div contenteditable="plaintext-only" style="${showSearch ? "width:128px" : "width:0;padding-left: 0;padding-right: 0;"}" data-type="av-search" class="b3-text-field b3-text-field--text" placeholder="${window.siyuan.languages.search}"></div>
</div>
<div class="fn__space"></div>
<span data-type="av-more" aria-label="${window.siyuan.languages.config}" data-position="8south" class="ariaLabel block__icon">

View file

@ -2387,7 +2387,7 @@ export class WYSIWYG {
this.element.addEventListener("paste", (event: ClipboardEvent & { target: HTMLElement }) => {
// https://github.com/siyuan-note/siyuan/issues/11241
if (event.target.getAttribute("data-type") === "av-search") {
if (hasClosestByAttribute(event.target, "data-type", "av-search")) {
return;
}
if (protyle.disabled) {

View file

@ -97,7 +97,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
event.stopPropagation();
return;
}
if (event.target.getAttribute("data-type") === "av-search") {
if (hasClosestByAttribute(event.target, "data-type", "av-search")) {
if (matchHotKey("⌘A", event)) {
event.preventDefault();
getSelection().getRangeAt(0).selectNodeContents(event.target);