MCPcopy Create free account
hub / github.com/adobe/react-spectrum / onHoverStart

Function onHoverStart

packages/react-aria/src/tooltip/useTooltipTrigger.ts:81–95  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

79 }, [ref, state]);
80
81 let onHoverStart = () => {
82 if (trigger === 'focus') {
83 return;
84 }
85 // In chrome, if you hover a trigger, then another element obscures it, due to keyboard
86 // interactions for example, hover will end. When hover is restored after that element disappears,
87 // focus moves on for example, then the tooltip will reopen. We check the modality to know if the hover
88 // is the result of moving the mouse.
89 if (getInteractionModality() === 'pointer') {
90 isHovered.current = true;
91 } else {
92 isHovered.current = false;
93 }
94 handleShow();
95 };
96
97 let onHoverEnd = () => {
98 if (trigger === 'focus') {

Callers

nothing calls this directly

Calls 2

getInteractionModalityFunction · 0.90
handleShowFunction · 0.85

Tested by

no test coverage detected