Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
markhuot committed Nov 29, 2023
1 parent 248ea8f commit 1d07493
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/models/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ public function withDisclosures(bool $withDisclosures = true): self
public function isCollapsed(): bool
{
$shouldBeClosed = $this->getType()->getSlotDefinitions()->every(fn ($defn) => $defn->isCollapsed());
$notForcedOpen = $this->disclosure->state !== 'open';
$forcedClosed = $this->disclosure->state == 'closed';

return ($shouldBeClosed && $this->disclosure->state !== 'open') ||
$this->disclosure->state == 'closed';
return ($shouldBeClosed && $notForcedOpen) || $forcedClosed;
}

/**
Expand Down

0 comments on commit 1d07493

Please sign in to comment.