T
TanStack•3y ago
generous-apricot

revalidateOnWindowFocus question

Guys, this may be a dumb question, but there is a way of "disable" the revalidateOnWindowFocus when i click a button that opens a modal? Or still revalidate the data but still open the modal? Today: 1- click outside the window 2- click in the button but the data is revalidated, doesn't open the modal 3- click again in the button and open the modal
5 Replies
conscious-sapphire
conscious-sapphire•3y ago
How does revalidating the data prevent the modal from opening?
fascinating-indigo
fascinating-indigo•3y ago
yeah, that's a good question @julien 😅 but also, in v5, just merely focussing a window will not trigger a refetchOnWindowFocus anymore. We're completely relying on the visibilitychange event there
generous-apricot
generous-apricotOP•3y ago
I have a table of users, each one of them have this icons, but when I refocus and click on some of those buttons it revalidate the data, not triggering the modal, so then I click again and it opens.
No description
generous-apricot
generous-apricotOP•3y ago
Yeah, I think this happens only when the chrome devtools is open. That's cool, thks. There is a second use case actually, when I click in the url input and then the button, it not trigger the modal. I have to double click in the button
conscious-sapphire
conscious-sapphire•3y ago
Data revalidation shouldn't prevent the modal from opening in this case. If you can share some code, we may be able to spot something.

Did you find this page helpful?