diff --git a/packages/ui/src/components/va-dropdown/VaDropdown.vue b/packages/ui/src/components/va-dropdown/VaDropdown.vue index fdd5ff07b2..03aec2e2f4 100644 --- a/packages/ui/src/components/va-dropdown/VaDropdown.vue +++ b/packages/ui/src/components/va-dropdown/VaDropdown.vue @@ -76,6 +76,7 @@ export default defineComponent({ ariaLabel: useTranslationProp('$t:toggleDropdown'), role: { type: String as PropType>, default: 'button' }, contentClass: { type: String, default: '' }, + focusAnchorOnClose: { type: Boolean, default: true }, }, emits: [...useStatefulEmits, 'anchor-click', 'anchor-right-click', 'content-click', 'click-outside', 'focus-outside', 'close', 'open', 'anchor-dblclick'], @@ -189,7 +190,8 @@ export default defineComponent({ focusFirstFocusableChild(el) }) } else { - if (!anchorRef.value) { return } + if (!anchorRef.value || !props.focusAnchorOnClose) { return } + focusFirstFocusableChild(anchorRef.value) } }) diff --git a/packages/ui/src/components/va-popover/VaPopover.vue b/packages/ui/src/components/va-popover/VaPopover.vue index f04f57fd84..6524f07579 100644 --- a/packages/ui/src/components/va-popover/VaPopover.vue +++ b/packages/ui/src/components/va-popover/VaPopover.vue @@ -6,6 +6,7 @@ :offset="$props.offset" :content-class="$props.contentClass" class="va-popover" + :focusAnchorOnClose="false" >