dbug fe: coax searchable list key into string

includes() only works on strings, but we might pass in other types as keys.
This commit is contained in:
Fang 2020-05-28 20:36:54 +02:00 committed by GitHub
parent 53b919965f
commit 8d2aad0de2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,7 +33,7 @@ export class SearchableList extends Component {
let items = props.items.filter(item => {
return state.query.split(' ').reduce((match, query) => {
return match && item.key.includes(query);
return match && ('' + item.key).includes(query);
}, true);
})
items = items.map(item =>
@ -46,4 +46,4 @@ export class SearchableList extends Component {
<div>{items.length === 0 ? 'none' : items}</div>
</div>);
}
}
}