htmx:after:history:push
Fires after history push
The htmx:after:history:push event fires specifically after a history.pushState() operation (creates new history entry).
When It Fires
After a new history entry is pushed, allowing forward/back navigation to this point.
Event Detail
-
path- The path that was pushed into history
Example
htmx.on('htmx:after:history:push', (evt) => {
console.log('Pushed to history:', evt.detail.path);
// Track navigation in analytics
}); This creates a new entry in the browser’s history stack.
Licensed under the Zero-Clause BSD License.
https://four.htmx.org/reference/events/htmx-after-push-into-history/