Components
← All components

Before-Cache Reset

stimeo--reset-before-cache

Resets transient UI on turbo:before-cache so Back restores a clean page.

  • Rails / Turbo

The stimeo--reset-before-cache controller is the most Hotwire-specific gap part: on turbo:before-cache it returns transient UI — open menus/modals, typed-in values, lingering toasts — to its initial state, so a page restored by the Back button is not frozen mid-interaction. Place one on <body>. It applies declarative data-reset-* cleanup within scope: data-reset-attr removes the listed attributes (open, aria-expanded…), data-reset-class removes the listed classes (is-open, is-loading…), data-reset-form runs form.reset(), data-reset-value clears a standalone field, data-reset-hidden re-hides an element, and data-reset-remove drops a node. When dispatchReset is on it first fires stimeo--reset-before-cache:request so individual controllers can run their own close logic, then emits stimeo--reset-before-cache:reset. It is idempotent (every run converges on the same state) and the listener is paired to connect/disconnect. Behavior only — it adds no state hooks, it removes them.

running

Open the details, type a value, and show the toast — then simulate the cache.

Open me

This panel is open. After the cache reset it returns to closed.