impress/app/javascript/application.js
Emi Matchu f20a1b5398 Oops, fix locale form with Turbo pageloads
Before this change, this would only work on the first pageload, and
fail after doing a Turbo page navigation. Now, it works all the time!
2024-09-20 18:55:08 -07:00

6 lines
175 B
JavaScript

import "@hotwired/turbo-rails";
document.addEventListener("change", (e) => {
if (!e.target.matches("#locale")) return;
document.getElementById("locale-form").submit();
});