Skip to content

Commit

Permalink
fix: data scope search cannot select
Browse files Browse the repository at this point in the history
  • Loading branch information
mintsweet committed Sep 26, 2024
1 parent 288be50 commit 74e0baf
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ export const SearchLocal = ({ mode, plugin, connectionId, config, disabledScope,
async (groupId?: string | number) => {
return {
data: searchDebounce
? scope
.filter((it) => it.title.includes(searchDebounce) && !it.canExpand)
.map((it) => ({ ...it, parentId: null }))
? scope.filter((it) => it.title.includes(searchDebounce) && !it.canExpand)
: scope.filter((it) => it.parentId === (groupId ?? null)),
hasMore: false,
};
Expand Down Expand Up @@ -238,7 +236,11 @@ export const SearchLocal = ({ mode, plugin, connectionId, config, disabledScope,
selectable
disabledIds={(disabledScope ?? []).map((it) => it.id)}
selectedIds={selectedScope.map((it) => it.id)}
onSelectedIds={(_, data) => onChange(data ?? [])}
onSelectedIds={(_, data) => {
console.log(_);
console.log(data);
onChange(data ?? []);
}}
/>
</>
)}
Expand Down

0 comments on commit 74e0baf

Please sign in to comment.