You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
interopImplementations are not interoperable with each othertopic: formsForms and form controls: input types, submission, constraint validation and autofilltopic: historySession history, the History interface, pushState(), popstate and scroll restoration
Should there be an event? It sounds like pageshow might be good enough for this, provided things are restored at that time. As noted in Clarify that form state restoration does not fire events #7283 it seems developers could also use formStateRestoreCallback for this, which makes it very observable when exactly this process takes place...
What I'm confused about (and maybe this is a separate issue) is how, exactly, the formStateRestore reaction should be triggered in the case of autocomplete. This is beginning to be an issue for the teams I support. If this is the right place to discuss that behavior, let me know; otherwise, I'd be happy to create a new issue.
I noticed that this issue might be causing problems like hydration mismatches when using a framework like Nuxt JS and UI components libraries (e.g., Nuxt UI). For example, setting a loading state on a button or another form component would also apply disabled = true, causing a hydration mismatch when reloading the page.
I put together a StackBlitz test in which I made two custom components (CustomButton and CustomButtonWithoutDisabled). The first one will put the button in a loading and disabled state when its property loading is set to true. The second one will just put it in a loading state—add a spinner and some styling. Upon reloading the page, the CustomButton component will have a hydration mismatch, while the CustomButtonWithoutDisabled component has no issue.
My opinion on the matter is that caching the disabled state should be in line with what other browsers are doing. If not, it causes unexpected behaviour only in Firefox, and developers need to create workarounds for one browser. Also, those workarounds might not always be straightforward when using libraries.
I also opened a related issue on the Nuxt framework repo before realizing this might be a browser problem.
interopImplementations are not interoperable with each othertopic: formsForms and form controls: input types, submission, constraint validation and autofilltopic: historySession history, the History interface, pushState(), popstate and scroll restoration
Activity
calebdwilliams commentedon Jul 19, 2022
Not sure if there has been any movement on this that hasn't been tracked on here specifically, but I would argue for
that for the custom element reaction, that specific state should be opt-in-able via the state previously set on
ElementInternals.prototype.setFormValuesince that method accepts both a form value and a state. Although it appears as if even Chrome is no longer callingformStateRestoreCallbackwith the previous state, only the value(warning: overly-simplistic demo).What I'm confused about (and maybe this is a separate issue) is how, exactly, the
formStateRestorereaction should be triggered in the case of autocomplete. This is beginning to be an issue for the teams I support. If this is the right place to discuss that behavior, let me know; otherwise, I'd be happy to create a new issue.rvetrsek commentedon Mar 10, 2025
Hi,
I noticed that this issue might be causing problems like hydration mismatches when using a framework like Nuxt JS and UI components libraries (e.g., Nuxt UI). For example, setting a loading state on a button or another form component would also apply
disabled = true,causing a hydration mismatch when reloading the page.I put together a StackBlitz test in which I made two custom components (CustomButton and CustomButtonWithoutDisabled). The first one will put the button in a loading and disabled state when its property loading is set to
true. The second one will just put it in a loading state—add a spinner and some styling. Upon reloading the page, the CustomButton component will have a hydration mismatch, while the CustomButtonWithoutDisabled component has no issue.My opinion on the matter is that caching the disabled state should be in line with what other browsers are doing. If not, it causes unexpected behaviour only in Firefox, and developers need to create workarounds for one browser. Also, those workarounds might not always be straightforward when using libraries.
I also opened a related issue on the Nuxt framework repo before realizing this might be a browser problem.
Nuxt JS issue: Hydration issue in Firefox #31296
StackBlitz example: StackBlitz