-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Labels
Description
Describe the bug
Using a query created with createQuery insided a SolidJs componenet causes inputs to lose focus whenever the query refetches.
Your minimal, reproducible example
https://stackblitz.com/edit/solid-vite-dlveck?file=src/index.tsx
Steps to reproduce
- Go to https://stackblitz.com/edit/solid-vite-dlveck?file=src/index.tsx
- Focus the first input beneath "tanstack query with suspense"
- The input will loose focus whenever the query updates/refetches
- (Updates are happening in 2 second intervall by the signal used as the query key updating from the setInterval)
Expected behavior
As a user i expected the focus to remain on the input element.
That behaviour can also be seen in the example below it "Tanstack query without suspense"
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
- OS: windows 11
- Browser: firerfox 110.0
TanStack Query version
v4.24.4
TypeScript version
No response
Additional context
I added an additional example "vanilla resource with suspense" with just the solidjs native "createResource" and suspense. I understand it is not 100% applicable to expect tanstack query to behave the same but i figured it might serve as indication that the issue is not a general bug with solid's suspense component.
Frantss, infi-pc, GersonDias, mattbdc and leaysgurGersonDias and mattbdc