T
TanStack3y ago
national-gold

Retching query inside Suspense resets focus

I have an input and a query output inside a suspense boundry. Whenever the query updates (provoked here with the interval, but issue is the same when setting an refetch interval), the input looses its focus. I don't think its solid rerendering the input, as the uncontroller input value is being kept. When i move the input outside of the suspsense, the focus is not lost. The native createResource also does not have this issue. Is it supposed to behave like that or is that a bug perhabs? Reproduction: https://stackblitz.com/edit/solid-vite-fog4ab?file=src/index.tsx
StackBlitz
solid query - StackBlitz
Starter project for Node.js
3 Replies
xenial-black
xenial-black3y ago
Hey there! Thanks for the detailed reproduction of this. This is a bug that will be fixed in v5. Could you create an GitHub issue for this? I'll patch it in v4 too! Apologies for the unexpected behavior here
national-gold
national-goldOP3y ago
oh wow sorry, didnt notice the reply. Thought I had this followed and discord would notify me. Thanks for the info, will file an github issue Any chance you also checked out the transitions issue I posted here aswell? Reading it now I see the phrasing is a little convoluted so i‘ll rephrase it when I get back to my pc but I do think it’s a valid issue, so input would be greatly be appreciated 😅 https://discord.com/channels/719702312431386674/1070397711716720760
national-gold
national-goldOP3y ago
GitHub
[solid] Refetching query inside resets focus · Issue #5010 · TanSt...
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....

Did you find this page helpful?