Skip to content

Commit

Permalink
Merge pull request #3733 from nextcloud/fix/header-menu-focus-throw
Browse files Browse the repository at this point in the history
Fix throw when header menu contains no tabbable nodes
  • Loading branch information
raimund-schluessler authored Feb 8, 2023
2 parents a48e4a9 + fe07eeb commit d53a8f8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/NcHeaderMenu/NcHeaderMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ export default {
:class="{ 'header-menu--opened': opened }"
class="header-menu">
<!-- Open trigger icon -->
<a class="header-menu__trigger"
<a ref="trigger"
class="header-menu__trigger"
href="#"
:aria-label="ariaLabel"
:aria-controls="`header-menu-${id}`"
Expand Down Expand Up @@ -254,6 +255,7 @@ export default {
this.focusTrap = createFocusTrap(contentContainer, {
allowOutsideClick: true,
trapStack: getTrapStack(),
fallbackFocus: this.$refs.trigger,
})
this.focusTrap.activate()
},
Expand Down

0 comments on commit d53a8f8

Please sign in to comment.