Respond to back button events (onpopstate) in the Runner filtered search
Description
Spin-off from: #329658 (closed)
The user should return to the previous search state when the user presses the back button:
Implementation details
The entry point of the admin runners page is located at: app/assets/javascripts/runner/admin_runners/admin_runners_app.vue
.
In order to respond to back button events we listen to window popstate
events when mounted
:
// Pseudo code!
mounted() {
window.addEventListener('popstate', () => {
this.search = fromUrlQueryToSearch();
});
},
Updating the this.search
object should update the current state to the filters and search bar, and also update the runners data.
Edited by Miguel Rincon