Replies: 1 comment 3 replies
-
Hmm Will keep this in mind though because we will likely be moving towards more things being batched. And on the microtask queue. If |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Example
Take a look at the example. Regardless of the fact that
inputRef.focus()
is called the input is not focused. This is because batching is in progress and the input still hasn't been rendered.https://playground.solidjs.com/anonymous/1da322c3-dded-42c5-a735-1dc8a3d5878e
Problem
I can't focus the input while staying inside of the
runWithOwner()
function.I can restructure the code to use Solid's button click handler but that's not the point. This is just an example. In the real world, I'm using a keyboard shortcuts library that subscribes to the
keydown
event.Possible solutions
flushSync()
functionRelated
3 years ago I logged the same issue for React that contains relevant discussion as well: facebook/react#18402
Beta Was this translation helpful? Give feedback.
All reactions