You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(HoverCard): add enableTouch prop for touch devices (#2687)
HoverCard ignores touch input by design (Radix parity), so it can't be
opened on mobile. Add an opt-in `enableTouch` prop that lets a tap toggle
the card open/closed, gated to `pointerType === 'touch'` so hover/mouse
behavior is unchanged. Toggle runs on `pointerup` so a scroll gesture
(which fires `pointercancel`) won't trigger it.
Also clear the pending open timer in `handleDismiss` so a dismiss can't be
reopened by a lingering focus/hover open timer.
Resolves#1969
Copy file name to clipboardExpand all lines: docs/content/meta/HoverCardRoot.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,13 @@
16
16
'required': false,
17
17
'default': 'false'
18
18
},
19
+
{
20
+
'name': 'enableTouch',
21
+
'description': '<p>When <code>true</code>, tapping the trigger on touch devices toggles the hover card open/closed. By default touch interactions are ignored to match pointer hover semantics.</p>\n',
22
+
'type': 'boolean',
23
+
'required': false,
24
+
'default': 'false'
25
+
},
19
26
{
20
27
'name': 'open',
21
28
'description': '<p>The controlled open state of the hover card. Can be binded as <code>v-model:open</code>.</p>\n',
@@ -56,6 +63,7 @@
56
63
| --- | --- | --- | --- | --- |
57
64
|`closeDelay`| The duration from when the mouse leaves the trigger or content until the hover card closes. |`number`| No |`300`|
58
65
|`defaultOpen`| The open state of the hover card when it is initially rendered. Use when you do not need to control its open state. |`boolean`| No |`false`|
66
+
|`enableTouch`| When true, tapping the trigger on touch devices toggles the hover card open/closed. By default touch interactions are ignored to match pointer hover semantics. |`boolean`| No |`false`|
59
67
|`open`| The controlled open state of the hover card. Can be binded as v-model:open. |`boolean`| No | - |
60
68
|`openDelay`| The duration from when the mouse enters the trigger until the hover card opens. |`number`| No |`700`|
/** The duration from when the mouse leaves the trigger or content until the hover card closes. */
13
13
closeDelay?:number
14
+
/** When `true`, tapping the trigger on touch devices toggles the hover card open/closed. By default touch interactions are ignored to match pointer hover semantics. */
15
+
enableTouch?:boolean
14
16
}
15
17
exporttypeHoverCardRootEmits= {
16
18
/** Event handler called when the open state of the hover card changes. */
0 commit comments