mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
feat: search for multiple words (#4362)
This commit is contained in:
@@ -17,10 +17,12 @@ const SearchBar = () => {
|
|||||||
if (e.key === "Enter") {
|
if (e.key === "Enter") {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (queryText !== "") {
|
if (queryText !== "") {
|
||||||
memoFilterStore.removeFilter((f) => f.factor === "contentSearch");
|
const words = queryText.split(" ");
|
||||||
memoFilterStore.addFilter({
|
words.forEach((word) => {
|
||||||
factor: "contentSearch",
|
memoFilterStore.addFilter({
|
||||||
value: queryText,
|
factor: "contentSearch",
|
||||||
|
value: word,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
setQueryText("");
|
setQueryText("");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user