fix(dropdown): wait "other" input to be disabled before autosave
Fix le workflow suivant pour un champ drop down avec option "autre" : - on choisit la valeur "autre" avec une valeur => ça autosave la bonne valeur - on choisit finalement une autre valeur proposée => l'autosave envoyait la nouvelle valeur, et toujours la valeur "other" car l'input n'était pas encore `disabled`. Par conséquent la valeur other overridait la valeur choisie et ça provoquait des erreurs en cascade, notamment dans le conditionnel.
This commit is contained in:
parent
c15ad573bc
commit
3265fff30e
2 changed files with 21 additions and 3 deletions
|
@ -89,9 +89,12 @@ export class AutosaveController extends ApplicationController {
|
|||
isCheckboxOrRadioInputElement(target) ||
|
||||
(!this.saveOnInput && isTextInputElement(target))
|
||||
) {
|
||||
this.enqueueAutosaveRequest();
|
||||
|
||||
this.showConditionnalSpinner(target);
|
||||
// Wait next tick so champs having JS can interact
|
||||
// with form elements before extracting form data.
|
||||
setTimeout(() => {
|
||||
this.enqueueAutosaveRequest();
|
||||
this.showConditionnalSpinner(target);
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue