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.
This commit is contained in:
nathan 2023-05-02 14:21:03 -06:00
parent 5427e220e4
commit 16767d91a6

View File

@ -864,6 +864,11 @@ const Et2WidgetMixin = <T extends Constructor>(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))