keep chosen dropdown item if user clicked on one

fixes a bug where in case multiple items with the same `value` are present in the combobox' dropdown, always the first one is returned in the `accept` event
This commit is contained in:
Martin Raifer
2024-06-05 19:56:56 +02:00
parent 97d1aa5e2d
commit 49492a0e06

View File

@@ -439,7 +439,9 @@ export function uiCombobox(context, klass) {
var val = utilGetSetValue(input);
thiz.setSelectionRange(val.length, val.length);
d = _fetched[val];
if (!d) {
d = _fetched[val];
}
dispatch.call('accept', thiz, d, val);
hide();
}