mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-07 07:30:23 +03:00
dbug fe: separate list query term with space
Allows searching for multiple parts of the item key separately, returning only items that match all.
This commit is contained in:
parent
d218541e4f
commit
6ae326470a
@ -32,7 +32,9 @@ export class SearchableList extends Component {
|
|||||||
);
|
);
|
||||||
|
|
||||||
let items = props.items.filter(item => {
|
let items = props.items.filter(item => {
|
||||||
return (state.query === '') || item.key.includes(state.query);
|
return state.query.split(' ').reduce((match, query) => {
|
||||||
|
return match && item.key.includes(query);
|
||||||
|
}, true);
|
||||||
})
|
})
|
||||||
if (items.length === 0) {
|
if (items.length === 0) {
|
||||||
items = 'none';
|
items = 'none';
|
||||||
|
Loading…
Reference in New Issue
Block a user