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

Function restoreFocus

packages/react-aria-components/test/Dialog.test.js:819–819  ·  view source on GitHub ↗
({defaultTarget})

Source from the content-addressed store, hash-verified

817 let [showTrigger, setShowTrigger] = React.useState(true);
818 let fallbackRef = useRef(null);
819 let restoreFocus = ({defaultTarget}) => defaultTarget ?? fallbackRef.current;
820 let dialog = (
821 <Dialog aria-label="Dialog">
822 <Button onPress={() => setShowTrigger(false)}>Remove trigger</Button>

Callers 1

PromptFieldVoiceButtonFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected