Fix student profile dates not saving
Native date pickers blur/refocus the window, which triggered a React Query refetch mid-edit and wiped the in-progress date. Disable refetchOnWindowFocus, and make profile/academics edits work on a snapshot with functional state updates so a background refetch can't clobber input. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+8
-1
@@ -3,7 +3,14 @@ import { createRouter } from "@tanstack/react-router";
|
||||
import { routeTree } from "./routeTree.gen";
|
||||
|
||||
export const getRouter = () => {
|
||||
const queryClient = new QueryClient();
|
||||
const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
// Don't refetch when the window regains focus — opening a native date
|
||||
// picker blurs/refocuses the window, which would refetch mid-edit and
|
||||
// wipe in-progress form input.
|
||||
queries: { refetchOnWindowFocus: false },
|
||||
},
|
||||
});
|
||||
|
||||
const router = createRouter({
|
||||
routeTree,
|
||||
|
||||
Reference in New Issue
Block a user