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

Function keepVisible

packages/react-aria/src/overlays/ariaHideOutside.ts:299–307  ·  view source on GitHub ↗
(element: Element)

Source from the content-addressed store, hash-verified

297}
298
299export function keepVisible(element: Element): (() => void) | undefined {
300 let observer = observerStack[observerStack.length - 1];
301 if (observer && !observer.visibleNodes.has(element)) {
302 observer.visibleNodes.add(element);
303 return () => {
304 observer.visibleNodes.delete(element);
305 };
306 }
307}

Callers 1

usePopoverFunction · 0.90

Calls 3

deleteMethod · 0.80
hasMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected