Skip to content

Commit

Permalink
fix(editor): collapse categories on page load
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
  • Loading branch information
st3iny committed Jun 20, 2023
1 parent c4789f3 commit 30b2172
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/components/Editor/Properties/PropertySelectMultiple.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@ export default {
})
},
},
async mounted() {

Check warning on line 150 in src/components/Editor/Properties/PropertySelectMultiple.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Editor/Properties/PropertySelectMultiple.vue#L150

Added line #L150 was not covered by tests
// Dirty hack but this forces a recaculation of collapsed categories. The resize event has
// to be dispatched multiple times for tag widths to be calculated correctly.
window.dispatchEvent(new Event('resize'))

Check warning on line 153 in src/components/Editor/Properties/PropertySelectMultiple.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Editor/Properties/PropertySelectMultiple.vue#L153

Added line #L153 was not covered by tests
await this.$nextTick()
window.dispatchEvent(new Event('resize'))

Check warning on line 155 in src/components/Editor/Properties/PropertySelectMultiple.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Editor/Properties/PropertySelectMultiple.vue#L155

Added line #L155 was not covered by tests
await this.$nextTick()
window.dispatchEvent(new Event('resize'))

Check warning on line 157 in src/components/Editor/Properties/PropertySelectMultiple.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Editor/Properties/PropertySelectMultiple.vue#L157

Added line #L157 was not covered by tests
},
created() {
for (const category of this.value) {
const option = this.options.find(option => option.value === category)
Expand Down

0 comments on commit 30b2172

Please sign in to comment.