Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Fix popout menu tab indices and buttons within being clickable when c…
Browse files Browse the repository at this point in the history
…losed (#107)
  • Loading branch information
Prospector authored Oct 17, 2023
1 parent 8369330 commit a3d4db9
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/components/base/PopoutMenu.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<template>
<div ref="dropdown" class="popup-container" tabindex="0" :aria-expanded="dropdownVisible">
<div ref="dropdown" class="popup-container" tabindex="-1" :aria-expanded="dropdownVisible">
<button
v-bind="$attrs"
ref="dropdownButton"
:class="{ 'popout-open': dropdownVisible }"
tabindex="-1"
@click="toggleDropdown"
>
<slot></slot>
Expand Down Expand Up @@ -145,10 +146,19 @@ onBeforeUnmount(() => {
left: calc(100% + var(--gap-sm) - 1rem);
}
&:not(.visible):not(:focus-within) {
pointer-events: none;
*,
::before,
::after {
pointer-events: none;
}
}
&.visible,
&:focus-within {
opacity: 1;
pointer-events: unset;
scale: 1;
&.position-bottom-left {
Expand Down

0 comments on commit a3d4db9

Please sign in to comment.