Skip to content

Commit

Permalink
Merge pull request #99 from nih-sparc/dropdown-multiselect-bug-fix
Browse files Browse the repository at this point in the history
fixed dropdown multiselect bug
  • Loading branch information
egauzens authored Mar 8, 2022
2 parents 9e9bb65 + 6d79d16 commit d38df46
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 56 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nih-sparc/sparc-design-system-components",
"version": "0.26.9",
"version": "0.26.10",
"private": false,
"scripts": {
"serve": "vue-cli-service serve",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,6 @@ export default {
},
},
watch: {
allVisibleDataIds(val) {
this.$refs.tree.filter(val)
},
optionsExpanded: function() {
this.$refs.tree.filter()
},
'visibleData': function() {
this.setShowAll();
}
Expand All @@ -194,6 +188,7 @@ export default {
})
}
if (this.showExpandOptionsContainer || this.visibleData !== undefined) {
this.numOptionsShown = 0;
this.$refs.tree.filter()
}
},
Expand Down Expand Up @@ -274,6 +269,7 @@ export default {
setOptionsExpanded(isExpanded) {
this.numOptionsShown = 0;
this.optionsExpanded = isExpanded
this.$refs.tree.filter()
},
setShowAll: function() {
const checkedNodes = this.visibleCheckedNodes
Expand Down
16 changes: 0 additions & 16 deletions src/stories/dropdownMultiselect/dropdownMultiselect.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,6 @@ export const OneOption = () => createDemo(
}
)

export const TwoOptions = () => createDemo(
{
label: 'Two Options',
id: '0',
data: [
{
label: 'One',
id: '1',
},
{
label: 'Two',
id: '2',
}]
}
)

export const NineOptions = () => createDemo(
{
label: 'Nine Options',
Expand Down
34 changes: 1 addition & 33 deletions src/stories/dropdownMultiselect/dropdownMultiselect.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,39 +54,7 @@ data() {
/>
```

### Less than 5 options Dropdown Multiselect

<Story name="Two Options">{stories.TwoOptions()}</Story>

#### Code

```js
data() {
return {
category: {
label: 'Two Options',
id: '0',
data: [
{
label: 'One',
id: '1',
},
{
label: 'Two',
id: '2',
}]
}
}
}
```

```html
<dropdown-multiselect
:category="category"
/>
```

### Between 5 and 9 options Dropdown Multiselect
### Between 2 and 9 options Dropdown Multiselect

<Story name="Nine Options">{stories.NineOptions()}</Story>

Expand Down

0 comments on commit d38df46

Please sign in to comment.