input elements become empty upon hydration
If I load a page developed using solid start on a slow connection, and enter some text in an input element while the javascript is still downloading in the background, the input element becomes empty as soon as the hydration kicks in
this is a very frustrating experience, is there any way to fix it?
2 Replies
ok so before hydration user changed the input value,
then during hydration solid reads from the signal bound to the
value
prop, and changed the input value to what’s in it.
which is an empty sting-the initial value of the signal.
would this be correct?
If that’s the case, then “all” you need to do is to update the initial value of the signal to the current input value on the client. you might need to use a query selector to get the input ref, as the ref
prop won’t be called yet
Also if you can reproduce that in a code sandbox, it may be worth making an issue for
it doesn’t sound right for the input value to be overridden by hydrationokay it turned out to be my fault, I didn't realise I was replacing the whole page during hydration