Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(VaPopover): Fixed closing other hover popovers on mouse leave #4301

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading