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
feat(json-render-ui): session-persist uncontrolled state and scroll position
`Tabs`/`Select`/`Switch`/`TextInput` fall back to a local, uncontrolled
value when a spec element has no `$bindState` binding on it — that
fallback used to be lost on every reload (and, for `Switch`/`TextInput`,
didn't exist at all: an unbound `value` had no working fallback since
`useBoundProp`'s setter is a no-op without a binding). `useSessionStorage`
now backs all four, keyed by the current dock (via a new
`DOCK_ENTRY_ID_KEY` `provide()`d by `JsonRenderView`) plus a signature of
the element's own static props, so it survives a reload without bleeding
into a different element of the same kind.
`JsonRenderView` also restores/persists its own scroll position per dock,
the same way.
Context: ports vitejs/devtools#527's `sessionStorage`-keyed uncontrolled-
value and scroll restoration to this package's registry component shape
(no `ctx.element` here, so the key is a caller-supplied signature instead
of an element id).
Co-authored-by: dvcolomban <90617742+dvcolomban@users.noreply.github.com>
0 commit comments