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

Function collapse

packages/@react-spectrum/s2/src/Toast.tsx:381–384  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

379 }, [queue, isExpanded, close]);
380
381 let collapse = () => {
382 regionRef.current?.focus();
383 ctx.toggleExpanded();
384 };
385
386 // Prevent scroll, aria hide outside, and contain focus when expanded, since we take over the whole screen.
387 // Attach event handler to the ref since ToastRegion doesn't pass through onKeyDown.

Callers 1

ToastContainerFunction · 0.85

Calls 1

focusMethod · 0.80

Tested by

no test coverage detected