Components
← All components

Persist

stimeo--persist

Saves form values to localStorage and restores them across reloads and Turbo visits.

  • Rails / Turbo

The stimeo--persist controller restores any saved values under key (falling back to the element's id) on connect, then debounce-saves on every input/change. It marks the form data-persist-restored when it restores, and dispatches stimeo--persist:restore / :save / :clear. Password fields — and anything listed in exclude — are never written. A clear() action, or the clearOn event (e.g. submit), drops the draft. Restoring never moves focus. Behavior only — state lives entirely in localStorage (no module-scope state), so multiple instances never interfere. The input listener and debounce timer are removed on disconnect (Turbo navigation included), where a pending save is flushed so an in-flight edit is not lost.

running

Draft restored.