Vanessa 2024-03-10 22:57:41 +08:00
parent aa01e99b0d
commit 9dac9aad56
3 changed files with 37 additions and 10 deletions

View file

@ -49,6 +49,19 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
return true;
}
const searchIconElement = hasClosestByAttribute(event.target, "data-type", "av-search-icon");
if (searchIconElement) {
const searchElement = blockElement.querySelector('input[data-type="av-search"]') as HTMLInputElement;
searchElement.style.width = "128px";
searchElement.style.paddingLeft = "";
searchElement.style.paddingRight = "";
searchElement.focus();
event.preventDefault();
event.stopPropagation();
return true;
}
if (protyle.disabled) {
return false;
}
@ -115,15 +128,6 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
event.preventDefault();
event.stopPropagation();
return true;
} else if (type === "av-search-icon") {
const searchElement = blockElement.querySelector('input[data-type="av-search"]') as HTMLInputElement;
searchElement.style.width = "128px";
searchElement.style.paddingLeft = "";
searchElement.style.paddingRight = "";
searchElement.focus();
event.preventDefault();
event.stopPropagation();
return true;
} else if (type === "av-filter") {
openMenuPanel({protyle, blockElement, type: "filters"});
event.preventDefault();