Skip to content

Commit

Permalink
feature: Control element is now optional
Browse files Browse the repository at this point in the history
The control element for `CollapsableItem` is now optional. If there is no control element, you can either expand / collapse the item programmatically from JS, or you can use an external link.
  • Loading branch information
zipper committed Nov 1, 2023
1 parent 631b28c commit e5b7303
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/CollapsableItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class CollapsableItem {
const controlElements = element.querySelectorAll<HTMLElement>(collapsable.options.control)
const boxElements = element.querySelectorAll<HTMLElement>(collapsable.options.box)

if (!controlElements.length || !boxElements.length) {
if (!boxElements.length) {
throw new Error(`Collapsable: Missing control or box element.'`)
}

Expand Down

0 comments on commit e5b7303

Please sign in to comment.