[JS] Handle correctly choice widgets where the display and the export values are different (issue #15815)

This commit is contained in:
Calixte Denizet 2022-12-13 00:07:45 +01:00
parent 64786b4c93
commit 0c1ec946aa
8 changed files with 155 additions and 30 deletions

View file

@ -137,6 +137,7 @@ class EventDispatcher {
case "Keystroke":
savedChange = {
value: event.value,
changeEx: event.changeEx,
change: event.change,
selStart: event.selStart,
selEnd: event.selEnd,
@ -170,6 +171,16 @@ class EventDispatcher {
if (event.willCommit) {
this.runValidation(source, event);
} else {
if (source.obj._isChoice) {
source.obj.value = savedChange.changeEx;
source.obj._send({
id: source.obj._id,
siblings: source.obj._siblings,
value: source.obj.value,
});
return;
}
const value = (source.obj.value = this.mergeChange(event));
let selStart, selEnd;
if (