From cb720024b1a22d3882036beb5577935e1bdffcba Mon Sep 17 00:00:00 2001 From: Mohamed Abbas Date: Thu, 23 Jan 2025 19:43:20 +0530 Subject: [PATCH] code updated for depending from multiselect --- lib/web/mage/adminhtml/form.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/web/mage/adminhtml/form.js b/lib/web/mage/adminhtml/form.js index 64b6039ffebef..9c69923b9de5a 100644 --- a/lib/web/mage/adminhtml/form.js +++ b/lib/web/mage/adminhtml/form.js @@ -472,7 +472,16 @@ define([ if (from) { values = valuesFrom[idFrom].values; - isInArray = values.indexOf(from.value) != -1; //eslint-disable-line + if (from.selectedOptions) { + isInArray = false; + Array.from(from.selectedOptions).map(o => o.value).forEach(function(selection) { + if (values.indexOf(selection) != -1) { + isInArray = true; + } + }); + } else { + isInArray = values.indexOf(from.value) != -1; //eslint-disable-line + } isNegative = valuesFrom[idFrom].negative; if (!from || isInArray && isNegative || !isInArray && !isNegative) {