From 3683ef9850db81bc7c2f69576b96022ca7255e93 Mon Sep 17 00:00:00 2001 From: "ICX\\Tatsiana.Hashtold" Date: Mon, 6 Nov 2023 17:28:26 +0300 Subject: [PATCH] FIO--7530: added ability to pass onSetItems component setting as a string (needed for builder mode) --- src/components/select/Select.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/select/Select.js b/src/components/select/Select.js index f976dbf96d..d41a252c6d 100644 --- a/src/components/select/Select.js +++ b/src/components/select/Select.js @@ -400,8 +400,10 @@ export default class SelectComponent extends ListComponent { } // Allow js processing (needed for form builder) - if (this.component.onSetItems && typeof this.component.onSetItems === 'function') { - const newItems = this.component.onSetItems(this, items); + if (this.component.onSetItems) { + const newItems = typeof this.component.onSetItems === 'function' + ? this.component.onSetItems(this, items) + : this.evaluate(this.component.onSetItems, { items: items }, 'items'); if (newItems) { items = newItems; }