Skip to content

Commit a1cd387

Browse files
authored
Merge pull request #1266 from ReactTooltip/fix/Issue-1223-events
fix: update tooltip types to allow click events properly
2 parents 6057d8c + 1a04317 commit a1cd387

1 file changed

Lines changed: 8 additions & 16 deletions

File tree

src/components/Tooltip/TooltipTypes.d.ts

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -85,22 +85,14 @@ export interface TooltipRefProps {
8585
isOpen: boolean
8686
}
8787

88-
export type AnchorOpenEvents = {
89-
mouseenter?: boolean
90-
focus?: boolean
91-
mouseover?: boolean
92-
click?: boolean
93-
dblclick?: boolean
94-
mousedown?: boolean
95-
}
96-
export type AnchorCloseEvents = {
97-
mouseleave?: boolean
98-
blur?: boolean
99-
mouseout?: boolean
100-
click?: boolean
101-
dblclick?: boolean
102-
mouseup?: boolean
103-
}
88+
type AnchorClickEvents = 'click' | 'dblclick' | 'mousedown' | 'mouseup'
89+
90+
export type AnchorOpenEvents = Partial<
91+
Record<'mouseenter' | 'focus' | 'mouseover' | AnchorClickEvents, boolean>
92+
>
93+
export type AnchorCloseEvents = Partial<
94+
Record<'mouseleave' | 'blur' | 'mouseout' | AnchorClickEvents, boolean>
95+
>
10496
export type GlobalCloseEvents = {
10597
escape?: boolean
10698
scroll?: boolean

0 commit comments

Comments
 (0)