Skip to content

Commit 1599512

Browse files
committed
feat(VTooltip): add new prop intertactive
add new prop that allows pointer-events on the tooltip itself resolves #19473
1 parent 011be15 commit 1599512

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

packages/api-generator/src/locale/en/VTooltip.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"closeDelay": "Delay (in ms) after which menu closes (when open-on-hover prop is set to true).",
44
"debounce": "Duration before tooltip is shown and hidden when hovered.",
55
"id": "HTML id attribute of the tooltip overlay. If not set, a globally unique id will be used.",
6+
"interactive": "When true, the tooltip will respond to pointer events, allowing you to copy text from it.",
67
"internalActivator": "Designates whether to use an internal activator.",
78
"openDelay": "Delay (in ms) after which tooltip opens (when `open-on-hover` prop is set to **true**).",
89
"openOnClick": "Designates whether the tooltip should open on activator click.",

packages/docs/src/data/new-in.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
},
4040
"VTooltip": {
4141
"props": {
42-
"eager": "3.2.0"
42+
"eager": "3.2.0",
43+
"interactive": "3.8.0"
4344
}
4445
}
4546
}

packages/vuetify/src/components/VTooltip/VTooltip.sass

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
text-transform: initial
1616
width: auto
1717
opacity: 1
18-
pointer-events: none
1918
transition-property: opacity, transform
2019
overflow-wrap: $tooltip-overflow-wrap
2120

@@ -26,3 +25,7 @@
2625
&[class*="leave-active"]
2726
transition-timing-function: settings.$accelerated-easing
2827
transition-duration: $tooltip-transition-leave-duration
28+
29+
&:not(.v-tooltip--interactive)
30+
> .v-overlay__content
31+
pointer-events: none

packages/vuetify/src/components/VTooltip/VTooltip.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import type { OverlaySlots } from '@/components/VOverlay/VOverlay'
2020

2121
export const makeVTooltipProps = propsFactory({
2222
id: String,
23+
interactive: Boolean,
2324
text: String,
2425

2526
...omit(makeVOverlayProps({
@@ -94,6 +95,7 @@ export const VTooltip = genericComponent<OverlaySlots>()({
9495
ref={ overlay }
9596
class={[
9697
'v-tooltip',
98+
{ 'v-tooltip--interactive': props.interactive },
9799
props.class,
98100
]}
99101
style={ props.style }

0 commit comments

Comments
 (0)