Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: fix https://github.com/siyuan-note/siyuan/issues/9801

Vanessa2f3440857714
diff --git a/app/src/mobile/menu/search.ts b/app/src/mobile/menu/search.ts
index 1b328efb99..9ced5ca7c4 100644
--- a/app/src/mobile/menu/search.ts
+++ b/app/src/mobile/menu/search.ts
@@ -721,5 +721,5 @@ const goAsset = () => {
clearCB() {
assetInputEvent(assetsElement, localSearch);
}
- })
+ });
};
diff --git a/app/src/search/assets.ts b/app/src/search/assets.ts
index 789c9073b8..0cfebc4a9f 100644
--- a/app/src/search/assets.ts
+++ b/app/src/search/assets.ts
@@ -122,6 +122,8 @@ export const openSearchAsset = (element: Element, isStick: boolean) => {
});
assetInputEvent(element, localSearch);
addClearButton({
+ right: 8,
+ height: searchInputElement.clientHeight,
inputElement: searchInputElement,
clearCB() {
assetInputEvent(element, localSearch);
diff --git a/app/src/search/util.ts b/app/src/search/util.ts
index 45439116da..a58c4f455c 100644
--- a/app/src/search/util.ts
+++ b/app/src/search/util.ts
@@ -954,13 +954,15 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
});
addClearButton({
inputElement: searchInputElement,
+ right: 8,
height: searchInputElement.clientHeight,
- clearCB () {
+ clearCB() {
config.page = 1;
inputEvent(element, config, edit);
}
});
addClearButton({
+ right: 8,
inputElement: replaceInputElement,
height: searchInputElement.clientHeight,
});
@@ -1114,7 +1116,7 @@ export const replace = (element: Element, config: ISearchOption, edit: Protyle,
const replaceInputElement = element.querySelector("#replaceInput") as HTMLInputElement;
const searchInputElement = element.querySelector("#searchInput") as HTMLInputElement;
- const loadElement = element.querySelector("#searchRefresh");
+ const loadElement = element.querySelector("svg.fn__rotate");
if (!loadElement.classList.contains("fn__none")) {
return;
}
diff --git a/app/src/util/addClearButton.ts b/app/src/util/addClearButton.ts
index fef5a6715c..6090bc876d 100644
--- a/app/src/util/addClearButton.ts
+++ b/app/src/util/addClearButton.ts
@@ -7,10 +7,10 @@ const update = (inputElement: HTMLInputElement, clearElement: Element, right: nu
} else {
clearElement.classList.remove("fn__none");
if (right) {
- inputElement.style.setProperty('padding-right', `${right * 2 + clearElement.clientWidth}px`, 'important');
+ inputElement.style.setProperty("padding-right", `${right * 2 + clearElement.clientWidth}px`, "important");
}
}
-}
+};
export const addClearButton = (options: {
inputElement: HTMLInputElement,
clearCB?: () => void,
@@ -19,7 +19,7 @@ export const addClearButton = (options: {
className?: string
}) => {
options.inputElement.insertAdjacentHTML("afterend",
- `<svg class="${options.className || "b3-form__icon-clear"}" style="${options.right ? "right: " + options.right + "px" : ""}${options.height ? "height:" + options.height + "px" : ""}">
+ `<svg class="${options.className || "b3-form__icon-clear"}" style="${options.right ? "right: " + options.right + "px;" : ""}${options.height ? "height:" + options.height + "px" : ""}">
<use xlink:href="#iconCloseRound"></use></svg>`);
const clearElement = options.inputElement.nextElementSibling;
clearElement.addEventListener("click", () => {
@@ -29,7 +29,7 @@ export const addClearButton = (options: {
if (options.clearCB) {
options.clearCB();
}
- })
+ });
options.inputElement.addEventListener("input", () => {
update(options.inputElement, clearElement, options.right);
});