From 46b7c5258b61710c24ef8bf5771520eb106e8790 Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 2 May 2023 14:21:03 -0600 Subject: [PATCH] Skip disabled widgets in iterateOver This fixes disabled widgets returning their value unexpectedly, and ID collisions when we have 2 widgets with the same ID, but disable one. --- api/js/etemplate/Et2Widget/Et2Widget.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/js/etemplate/Et2Widget/Et2Widget.ts b/api/js/etemplate/Et2Widget/Et2Widget.ts index a6bd1293a6..bbd6f8f4ef 100644 --- a/api/js/etemplate/Et2Widget/Et2Widget.ts +++ b/api/js/etemplate/Et2Widget/Et2Widget.ts @@ -864,6 +864,11 @@ const Et2WidgetMixin = (superClass : T) => iterateOver(_callback : Function, _context, _type) { + if(this.disabled) + { + // Don't if we're disabled + return; + } if(typeof _type === "undefined" || _type === et2_widget || _type === Et2Widget || typeof _type === 'function' && this instanceof _type || et2_implements_registry[_type] && et2_implements_registry[_type](this))