Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
[OcSelect] Fix search for options provided as objects
Browse files Browse the repository at this point in the history
  • Loading branch information
dschmidt committed Aug 21, 2021
1 parent 1ff6937 commit ff9dcbe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Bugfix: Fix search for options provided as objects

We fixed a regression that was introduced in https://github.com/owncloud/owncloud-design-system/pull/1521.
`vue-select` automatically uses the property specified in `label` for filtering.
When custom filtering based on Fuse.js was introduced that functionality got lost.
Hence it was not possible to filter objects at all.


https://github.com/owncloud/owncloud-design-system/pull/1602
3 changes: 2 additions & 1 deletion src/components/OcSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@ export default {
filter: {
type: Function,
required: false,
default: (items, search) => {
default: (items, search, props) => {
if (items.length < 1) {
return []
}
const fuse = new Fuse(items, {
keys: props.label ? [props.label] : [],
shouldSort: true,
threshold: 0.2,
location: 0,
Expand Down

0 comments on commit ff9dcbe

Please sign in to comment.