MCPcopy Create free account
hub / github.com/react-dropzone/react-dropzone / onWindowFocus

Function onWindowFocus

src/index.js:495–509  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

493
494 // Update file dialog active state when the window is focused on
495 const onWindowFocus = () => {
496 // Execute the timeout only if the file dialog is opened in the browser
497 if (!fsAccessApiWorksRef.current && isFileDialogActive) {
498 setTimeout(() => {
499 if (inputRef.current) {
500 const { files } = inputRef.current;
501
502 if (!files.length) {
503 dispatch({ type: "closeDialog" });
504 onFileDialogCancelCb();
505 }
506 }
507 }, 300);
508 }
509 };
510 useEffect(() => {
511 window.addEventListener("focus", onWindowFocus, false);
512 return () => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…