From 148b02464d47ada421313327585924b17f4e3f2d Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Fri, 29 Nov 2024 16:39:35 +0100 Subject: [PATCH] fix(components): specify collisionPadding to all menus --- src/runtime/components/DropdownMenu.vue | 4 ++-- src/runtime/components/InputMenu.vue | 4 ++-- src/runtime/components/Popover.vue | 4 ++-- src/runtime/components/Select.vue | 4 ++-- src/runtime/components/SelectMenu.vue | 4 ++-- src/runtime/components/Tooltip.vue | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/runtime/components/DropdownMenu.vue b/src/runtime/components/DropdownMenu.vue index e6e5570c..263a876b 100644 --- a/src/runtime/components/DropdownMenu.vue +++ b/src/runtime/components/DropdownMenu.vue @@ -52,7 +52,7 @@ export interface DropdownMenuProps extends Omit loadingIcon?: string /** * The content of the menu. - * @defaultValue { side: 'bottom', sideOffset: 8 } + * @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8 } */ content?: Omit /** @@ -154,7 +154,7 @@ const emits = defineEmits() const slots = defineSlots>() const rootProps = useForwardPropsEmits(reactivePick(props, 'defaultOpen', 'open', 'modal'), emits) -const contentProps = toRef(() => defu(props.content, { side: 'bottom', sideOffset: 8 }) as DropdownMenuContentProps) +const contentProps = toRef(() => defu(props.content, { side: 'bottom', sideOffset: 8, collisionPadding: 8 }) as DropdownMenuContentProps) const arrowProps = toRef(() => props.arrow as DropdownMenuArrowProps) const proxySlots = omit(slots, ['default']) as Record[string]> diff --git a/src/runtime/components/InputMenu.vue b/src/runtime/components/InputMenu.vue index 617b246c..28f238c4 100644 --- a/src/runtime/components/InputMenu.vue +++ b/src/runtime/components/InputMenu.vue @@ -64,7 +64,7 @@ export interface InputMenuProps, I extends Ma deleteIcon?: string /** * The content of the menu. - * @defaultValue { side: 'bottom', sideOffset: 8, position: 'popper' } + * @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8, position: 'popper' } */ content?: Omit /** @@ -168,7 +168,7 @@ const searchTerm = defineModel('searchTerm', { default: '' }) const appConfig = useAppConfig() const { t } = useLocale() const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'modelValue', 'defaultValue', 'selectedValue', 'open', 'defaultOpen', 'multiple', 'resetSearchTermOnBlur'), emits) -const contentProps = toRef(() => defu(props.content, { side: 'bottom', sideOffset: 8, position: 'popper' }) as ComboboxContentProps) +const contentProps = toRef(() => defu(props.content, { side: 'bottom', sideOffset: 8, collisionPadding: 8, position: 'popper' }) as ComboboxContentProps) const arrowProps = toRef(() => props.arrow as ComboboxArrowProps) const { emitFormBlur, emitFormChange, emitFormInput, size: formGroupSize, color, id, name, highlight, disabled } = useFormField(props) diff --git a/src/runtime/components/Popover.vue b/src/runtime/components/Popover.vue index 19fac3c6..e7c7d1ac 100644 --- a/src/runtime/components/Popover.vue +++ b/src/runtime/components/Popover.vue @@ -18,7 +18,7 @@ export interface PopoverProps extends PopoverRootProps, Pick /** @@ -68,7 +68,7 @@ const slots = defineSlots() const pick = props.mode === 'hover' ? reactivePick(props, 'defaultOpen', 'open', 'openDelay', 'closeDelay') : reactivePick(props, 'defaultOpen', 'open', 'modal') const rootProps = useForwardPropsEmits(pick, emits) -const contentProps = toRef(() => defu(props.content, { side: 'bottom', sideOffset: 8 }) as PopoverContentProps) +const contentProps = toRef(() => defu(props.content, { side: 'bottom', sideOffset: 8, collisionPadding: 8 }) as PopoverContentProps) const contentEvents = computed(() => { if (props.preventClose) { return { diff --git a/src/runtime/components/Select.vue b/src/runtime/components/Select.vue index e0a3fa0f..d3edaf6b 100644 --- a/src/runtime/components/Select.vue +++ b/src/runtime/components/Select.vue @@ -48,7 +48,7 @@ export interface SelectProps, I extends Maybe selectedIcon?: string /** * The content of the menu. - * @defaultValue { side: 'bottom', sideOffset: 8, position: 'popper' } + * @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8, position: 'popper' } */ content?: Omit /** @@ -124,7 +124,7 @@ const slots = defineSlots>() const appConfig = useAppConfig() const rootProps = useForwardPropsEmits(reactivePick(props, 'modelValue', 'defaultValue', 'open', 'defaultOpen', 'disabled', 'autocomplete', 'required'), emits) -const contentProps = toRef(() => defu(props.content, { side: 'bottom', sideOffset: 8, position: 'popper' }) as SelectContentProps) +const contentProps = toRef(() => defu(props.content, { side: 'bottom', sideOffset: 8, collisionPadding: 8, position: 'popper' }) as SelectContentProps) const arrowProps = toRef(() => props.arrow as SelectArrowProps) const { emitFormChange, emitFormInput, emitFormBlur, size: formGroupSize, color, id, name, highlight, disabled } = useFormField(props) diff --git a/src/runtime/components/SelectMenu.vue b/src/runtime/components/SelectMenu.vue index a222c230..5330c5c8 100644 --- a/src/runtime/components/SelectMenu.vue +++ b/src/runtime/components/SelectMenu.vue @@ -56,7 +56,7 @@ export interface SelectMenuProps, I extends M selectedIcon?: string /** * The content of the menu. - * @defaultValue { side: 'bottom', sideOffset: 8, position: 'popper' } + * @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8, position: 'popper' } */ content?: Omit /** @@ -161,7 +161,7 @@ const appConfig = useAppConfig() const { t } = useLocale() const rootProps = useForwardPropsEmits(reactivePick(props, 'modelValue', 'defaultValue', 'selectedValue', 'open', 'defaultOpen', 'multiple', 'resetSearchTermOnBlur'), emits) -const contentProps = toRef(() => defu(props.content, { side: 'bottom', sideOffset: 8, position: 'popper' }) as ComboboxContentProps) +const contentProps = toRef(() => defu(props.content, { side: 'bottom', sideOffset: 8, collisionPadding: 8, position: 'popper' }) as ComboboxContentProps) const arrowProps = toRef(() => props.arrow as ComboboxArrowProps) const searchInputProps = toRef(() => defu(props.searchInput, { placeholder: 'Search...', variant: 'none' }) as InputProps) diff --git a/src/runtime/components/Tooltip.vue b/src/runtime/components/Tooltip.vue index 42994ea6..6d38c5e6 100644 --- a/src/runtime/components/Tooltip.vue +++ b/src/runtime/components/Tooltip.vue @@ -18,7 +18,7 @@ export interface TooltipProps extends TooltipRootProps { kbds?: KbdProps['value'][] | KbdProps[] /** * The content of the tooltip. - * @defaultValue { side: 'bottom', sideOffset: 8 } + * @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8 } */ content?: Omit /** @@ -59,7 +59,7 @@ const emits = defineEmits() const slots = defineSlots() const rootProps = useForwardPropsEmits(reactivePick(props, 'defaultOpen', 'open', 'delayDuration', 'disableHoverableContent', 'disableClosingTrigger', 'disabled', 'ignoreNonKeyboardFocus'), emits) -const contentProps = toRef(() => defu(props.content, { side: 'bottom', sideOffset: 8 }) as TooltipContentProps) +const contentProps = toRef(() => defu(props.content, { side: 'bottom', sideOffset: 8, collisionPadding: 8 }) as TooltipContentProps) const arrowProps = toRef(() => props.arrow as TooltipArrowProps) // eslint-disable-next-line vue/no-dupe-keys