osl-base-extended 12.5.0 → 12.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4472,14 +4472,18 @@ class OslFormGrid {
|
|
|
4472
4472
|
if (!col.formElem?.change)
|
|
4473
4473
|
return;
|
|
4474
4474
|
const elem = col.formElem;
|
|
4475
|
+
// Autocomplete's live options live in the per-row cache (see getAutocompleteDatasource),
|
|
4476
|
+
// not elem.datasource — that field is only ever the static config list and is never
|
|
4477
|
+
// written to per-row, so API search results would never be found there.
|
|
4478
|
+
const list = elem.elementType === 'autocomplete' ? this.getAutocompleteDatasource(row, col) : elem.datasource;
|
|
4475
4479
|
let selectedObj = undefined;
|
|
4476
|
-
if (
|
|
4480
|
+
if (list) {
|
|
4477
4481
|
if (Array.isArray(value)) {
|
|
4478
|
-
selectedObj = value.map(v =>
|
|
4482
|
+
selectedObj = value.map(v => list.find(item => (elem.valueField ? item[elem.valueField] : item) === v) ?? null);
|
|
4479
4483
|
}
|
|
4480
4484
|
else if (value !== null && value !== undefined) {
|
|
4481
4485
|
selectedObj =
|
|
4482
|
-
|
|
4486
|
+
list.find(item => (elem.valueField ? item[elem.valueField] : item) === value) ?? null;
|
|
4483
4487
|
}
|
|
4484
4488
|
else {
|
|
4485
4489
|
selectedObj = null;
|