diff --git a/app/src/search/util.ts b/app/src/search/util.ts index 8534f8e16..2a33e3936 100644 --- a/app/src/search/util.ts +++ b/app/src/search/util.ts @@ -561,6 +561,22 @@ export const genSearch = (app: App, config: Config.IUILayoutTabSearchConfig, ele return true; } }); + if (target.parentElement.classList.contains('b3-chip--current')) { + updateConfig(element, { + removed: true, + sort: 0, + group: 0, + hasReplace: false, + method: 0, + hPath: "", + idPath: [], + k: "", + r: "", + page: 1, + types: getDefaultType(), + replaceTypes: Object.assign({}, Constants.SIYUAN_DEFAULT_REPLACETYPES), + }, config, edit, true); + } target.parentElement.remove(); event.stopPropagation(); event.preventDefault(); @@ -1073,7 +1089,7 @@ export const getQueryTip = (method: number) => { }; export const updateConfig = (element: Element, item: Config.IUILayoutTabSearchConfig, config: Config.IUILayoutTabSearchConfig, - edit: Protyle, clear = false) => { + edit: Protyle, clear = false) => { const dialogElement = hasClosestByClassName(element, "b3-dialog--open"); if (dialogElement && dialogElement.getAttribute("data-key") === Constants.DIALOG_SEARCH) { // https://github.com/siyuan-note/siyuan/issues/6828