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

Function onHoverChange

packages/react-aria/src/menu/useSubmenuTrigger.ts:248–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246 };
247
248 let onHoverChange = isHovered => {
249 if (!isDisabled) {
250 if (isHovered && !state.isOpen) {
251 if (!openTimeout.current) {
252 openTimeout.current = setTimeout(() => {
253 onSubmenuOpen();
254 }, delay);
255 }
256 } else if (!isHovered) {
257 cancelOpenTimeout();
258 }
259 }
260 };
261
262 useEvent(parentMenuRef, 'focusin', e => {
263 // If we detect focus moved to a different item in the same menu that the currently open submenu trigger is in

Callers 2

triggerHoverStartFunction · 0.85
triggerHoverEndFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected