Skip to content

Commit

Permalink
fix(VaPopover): Fixed closing other hover popovers on mouse leave
Browse files Browse the repository at this point in the history
  • Loading branch information
Fsss126 committed May 30, 2024
1 parent 0ffdb22 commit 3cdeff2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/ui/src/components/va-dropdown/VaDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export default defineComponent({
ariaLabel: useTranslationProp('$t:toggleDropdown'),
role: { type: String as PropType<StringWithAutocomplete<'button' | 'none'>>, 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'],
Expand Down Expand Up @@ -189,7 +190,8 @@ export default defineComponent({
focusFirstFocusableChild(el)
})
} else {
if (!anchorRef.value) { return }
if (!anchorRef.value || !props.focusAnchorOnClose) { return }
focusFirstFocusableChild(anchorRef.value)
}
})
Expand Down
3 changes: 2 additions & 1 deletion packages/ui/src/components/va-popover/VaPopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
:offset="$props.offset"
:content-class="$props.contentClass"
class="va-popover"
:focusAnchorOnClose="false"
>
<template #default>
<div
Expand Down Expand Up @@ -46,7 +47,7 @@ import { useComponentPresetProp, useColors, useTextColor } from '../../composabl
import { VaDropdown, VaIcon } from '../'
const VaDropdownProps = extractComponentProps(VaDropdown, ['closeOnClickOutside'])
const VaDropdownProps = extractComponentProps(VaDropdown, ['closeOnClickOutside', 'focusAnchorOnClose'])
</script>

<script lang="ts" setup>
Expand Down

0 comments on commit 3cdeff2

Please sign in to comment.