Vanessa 2024-08-18 11:34:21 +08:00
parent d6e3c626a8
commit f8fc8ff9b1

View file

@ -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