Skip to content

Commit

Permalink
fix wui-list-accordion
Browse files Browse the repository at this point in the history
  • Loading branch information
svenvoskamp committed Feb 21, 2024
1 parent 0bbd3ce commit a2136f7
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions packages/ui/src/composites/wui-list-accordion/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,22 @@ export class WuiListAccordion extends LitElement {

// -- State & Properties -------------------------------- //
@property() public textTitle = ''

@property() public overflowedContent = ''

public toggled = false

public enableAccordion = false

public scrollElement?: Element = undefined

public scrollHeightElement = 0

public override firstUpdated() {
setTimeout(() => {
public override updated(changedProperties: Map<string | number | symbol, unknown>) {
super.updated(changedProperties)
if (changedProperties.has('textTitle') || changedProperties.has('overflowedContent')) {
this.checkHeight()
}
}

private checkHeight() {
this.updateComplete.then(() => {
const heightElement = this.shadowRoot?.querySelector('.heightContent')
const textElement = this.shadowRoot?.querySelector('.textContent')

Expand All @@ -41,7 +44,7 @@ export class WuiListAccordion extends LitElement {
this.requestUpdate()
}
}
}, 0)
})
}

// -- Render -------------------------------------------- //
Expand Down

0 comments on commit a2136f7

Please sign in to comment.