T
TanStack11mo ago
sunny-green

Will calling mutate trigger Window Focus?

I put a Button in a Popover component. The click event is to call the mutate method of useMutation. After clicking and requesting, the Popover automatically closes.
4 Replies
extended-salmon
extended-salmon11mo ago
no
sunny-green
sunny-greenOP11mo ago
I excluded a lot of code that was calling the mutate method and then my popover closed, even though I didn't make any data changes, just a request
rare-sapphire
rare-sapphire11mo ago
Does your button have type="button" on it? Pretty sure any button inside a form will default to type="submit"
sunny-green
sunny-greenOP11mo ago
I found the problem. It was caused by setting the disabled attribute of the button.

Did you find this page helpful?