mirror of
https://github.com/we-promise/sure.git
synced 2026-04-08 23:04:49 +00:00
FIX add debounce for field
and refresh only form update
This commit is contained in:
@@ -46,14 +46,22 @@ export default class extends Controller {
|
||||
}
|
||||
|
||||
refreshForm(event) {
|
||||
const form = event.target.closest("form");
|
||||
const input = document.createElement("input");
|
||||
input.type = "hidden";
|
||||
input.name = "refresh_only";
|
||||
input.value = "true";
|
||||
form.appendChild(input);
|
||||
clearTimeout(this.refreshTimeout);
|
||||
|
||||
form.requestSubmit();
|
||||
const form = event.target.closest("form");
|
||||
|
||||
this.refreshTimeout = setTimeout(() => {
|
||||
const input = document.createElement("input");
|
||||
input.type = "hidden";
|
||||
input.name = "refresh_only";
|
||||
input.value = "true";
|
||||
form.appendChild(input);
|
||||
|
||||
// Temporarily disable validation for refresh-only submission
|
||||
form.setAttribute("novalidate", "");
|
||||
form.requestSubmit();
|
||||
form.removeAttribute("novalidate");
|
||||
}, 500);
|
||||
}
|
||||
|
||||
#showAmountTypeValueTargets(amountTypeColumnKey) {
|
||||
|
||||
Reference in New Issue
Block a user