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

Enhancement: Make tooltip collision avoidance opt-out #1452

Merged
merged 2 commits into from
Sep 23, 2024
Merged
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
3 changes: 2 additions & 1 deletion src/components/Tooltip/PTooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<TooltipContent
v-bind="delegatedContentProps"
:as-child="Boolean($slots.tooltip)"
:avoid-collisions="!allowCollisions"
>
<slot name="tooltip">
<slot name="content">
Expand All @@ -28,7 +29,7 @@
import TooltipTrigger from '@/components/Tooltip/PTooltipTrigger.vue'

const props = withDefaults(
defineProps<TooltipRootProps & TooltipProviderProps & Omit<TooltipContentProps, 'asChild' | 'as'> & { text?: string }>(),
defineProps<TooltipRootProps & TooltipProviderProps & Omit<TooltipContentProps, 'asChild' | 'as'> & { text?: string, allowCollisions?: boolean }>(),

Check warning on line 32 in src/components/Tooltip/PTooltip.vue

View workflow job for this annotation

GitHub Actions / ESLint

'forceMount' of property found, but never used
{
text: undefined,
// Mimicking radix-vue's TooltipRoot props. These need to be undefined rather than Vue's default behavior of
Expand Down
3 changes: 2 additions & 1 deletion src/components/Tooltip/PTooltipContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
bg-popover
px-3
py-1.5
text-sm
text-xs
font-mono
text-popover-foreground
shadow-md
animate-in
Expand Down
Loading