fix(autosave): validate select onChangeable et on retry

This commit is contained in:
Colin Darie 2024-12-11 15:20:59 +01:00
parent 009e426c31
commit 1c6d012f44
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4

View file

@ -80,11 +80,13 @@ export class AutosaveController extends ApplicationController {
// Wait next tick so champs having JS can interact // Wait next tick so champs having JS can interact
// with form elements before extracting form data. // with form elements before extracting form data.
setTimeout(() => { setTimeout(() => {
this.enqueueAutosaveRequest(); this.enqueueAutosaveWithValidationRequest();
this.showConditionnalSpinner(target); this.showConditionnalSpinner(target);
}, 0); }, 0);
}, },
inputable: (target) => this.enqueueOnInput(target, true), inputable: (target) => {
this.enqueueOnInput(target, true);
},
hidden: (target) => { hidden: (target) => {
// In comboboxes we dispatch a "change" event on hidden inputs to trigger autosave. // In comboboxes we dispatch a "change" event on hidden inputs to trigger autosave.
// We want to debounce them. // We want to debounce them.
@ -152,7 +154,7 @@ export class AutosaveController extends ApplicationController {
private didRequestRetry() { private didRequestRetry() {
if (this.#needsRetry) { if (this.#needsRetry) {
this.enqueueAutosaveRequest(); this.enqueueAutosaveWithValidationRequest();
} }
} }