MCPcopy Index your code
hub / github.com/adobe/react-spectrum / collapse

Function collapse

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

Source from the content-addressed store, hash-verified

388 }, [queue, isExpanded, close]);
389
390 let collapse = () => {
391 regionRef.current?.focus();
392 ctx.toggleExpanded();
393 };
394
395 // Prevent scroll, aria hide outside, and contain focus when expanded, since we take over the whole screen.
396 // 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