T
TanStack14mo ago
secure-lavender

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
flat-fuchsia
flat-fuchsia14mo ago
no
secure-lavender
secure-lavenderOP14mo 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
xenial-black
xenial-black14mo ago
Does your button have type="button" on it? Pretty sure any button inside a form will default to type="submit"
secure-lavender
secure-lavenderOP14mo ago
I found the problem. It was caused by setting the disabled attribute of the button.

Did you find this page helpful?