Skip to content

Commit c603fbd

Browse files
authored
Merge pull request #498 from igorsantos07/patch-1
Allow banners to have no action buttons
2 parents 026d423 + 0961fe7 commit c603fbd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/banner/src/Banner.svelte

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,10 @@
134134
}
135135
136136
onMount(() => {
137-
focusTrap = new FocusTrap(element, {
138-
initialFocusEl: getPrimaryActionEl(),
139-
});
137+
let initialFocusEl = getPrimaryActionEl();
138+
if (initialFocusEl) {
139+
focusTrap = new FocusTrap(element, { initialFocusEl });
140+
}
140141
141142
instance = new MDCBannerFoundation({
142143
addClass,

0 commit comments

Comments
 (0)