Skip to content

Commit

Permalink
fix(ComboboxContent): ignore dismissableLayer (#606)
Browse files Browse the repository at this point in the history
  • Loading branch information
zernonia committed Jan 13, 2024
1 parent 0fe7be9 commit a42d899
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions packages/radix-vue/src/Combobox/ComboboxContentImpl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export type ComboboxContentImplEmits = DismissableLayerEmits
export interface ComboboxContentImplProps extends PopperContentProps {
position?: 'inline' | 'popper'
bodyLock?: boolean
dismissable?: boolean
disableOutsidePointerEvents?: boolean
}
Expand All @@ -37,6 +38,7 @@ import { CollectionSlot } from '@/Collection'
const props = withDefaults(defineProps<ComboboxContentImplProps>(), {
position: 'inline',
dismissable: true,
})
const emits = defineEmits<ComboboxContentImplEmits>()
Expand Down Expand Up @@ -81,6 +83,7 @@ provideComboboxContentContext({ position })
<template>
<CollectionSlot>
<DismissableLayer
v-if="dismissable"
as-child
:disable-outside-pointer-events="disableOutsidePointerEvents"
@dismiss="rootContext.onOpenChange(false)"
Expand Down Expand Up @@ -117,5 +120,26 @@ provideComboboxContentContext({ position })
<slot />
</component>
</DismissableLayer>
<component
:is="position === 'popper' ? PopperContent : Primitive "
v-else
v-bind="{ ...$attrs, ...pickedProps }"
:id="rootContext.contentId"
ref="primitiveElement"
role="listbox"
:data-state="rootContext.open.value ? 'open' : 'closed'"
:style="{
// flex layout so we can place the scroll buttons properly
display: 'flex',
flexDirection: 'column',
// reset the outline by default as the content MAY get focused
outline: 'none',
...(position === 'popper' ? popperStyle : {}),
}"
@pointerleave="handleLeave"
>
<slot />
</component>
</CollectionSlot>
</template>

0 comments on commit a42d899

Please sign in to comment.