Skip to content

Commit

Permalink
fix(sbb-selection-panel): fix data-state on selection panels with no …
Browse files Browse the repository at this point in the history
…content (#2236)
  • Loading branch information
dauriamarco authored Nov 28, 2023
1 parent 20bd849 commit 2b67f4b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/selection-panel/selection-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export class SbbSelectionPanel extends LitElement {

this._checked = event.detail.checked;

if (this.forceOpen) {
if (!this._namedSlots['content'] || this.forceOpen) {
return;
}

Expand Down Expand Up @@ -161,7 +161,8 @@ export class SbbSelectionPanel extends LitElement {

private _updateSelectionPanel(): void {
this._checked = this._input?.checked;
this._state = this._checked || this.forceOpen ? 'opened' : 'closed';
this._state =
this._checked || this.forceOpen || !this._namedSlots['content'] ? 'opened' : 'closed';
this._disabled = this._input?.disabled;
}

Expand Down

0 comments on commit 2b67f4b

Please sign in to comment.