Skip to content

Commit

Permalink
fix: toolbar should not throw if start/end slots do not exist (#6770)
Browse files Browse the repository at this point in the history
* fix: toolbar should not throw if start or end is undefined

* Change files
  • Loading branch information
chrisdholt authored Jul 6, 2023
1 parent 3217e47 commit adaaeb6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "fix: toolbar should not throw if start or end is undefined",
"packageName": "@microsoft/fast-foundation",
"email": "[email protected]",
"dependentChangeType": "prerelease"
}
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,10 @@ export class FASTToolbar extends FASTElement {
* @internal
*/
protected get allSlottedItems(): (HTMLElement | Node)[] {
return [
...this.start.assignedElements(),
...this.slottedItems,
...this.end.assignedElements(),
];
const start = this.start?.assignedElements() ?? [];
const end = this.end?.assignedElements() ?? [];

return [...start, ...this.slottedItems, ...end];
}

/**
Expand Down

0 comments on commit adaaeb6

Please sign in to comment.