Fix hidden tabs did not make children readonly

Fixes required fields on hidden tabs still got validated
This commit is contained in:
nathan 2023-02-14 10:09:58 -07:00
parent 704291d80b
commit 68caabe1ae
2 changed files with 5 additions and 3 deletions

View File

@ -849,7 +849,7 @@ const Et2WidgetMixin = <T extends Constructor>(superClass : T) =>
iterateOver(_callback : Function, _context, _type)
{
if (typeof _type === "undefined" || _type === et2_widget || _type === Et2Widget ||
if(typeof _type === "undefined" || _type === et2_widget || _type === Et2Widget ||
typeof _type === 'function' && this instanceof _type ||
et2_implements_registry[_type] && et2_implements_registry[_type](this))
{
@ -1371,7 +1371,7 @@ export function loadWebComponent(_nodeName : string, _template_node : Element|{[
const readonly = parent?.getArrayMgr("readonlys") ?
(<any>parent.getArrayMgr("readonlys")).isReadOnly(
attrs["id"], attrs["readonly"],
typeof parent?.readonly !== "undefined" ? parent.readonly : false) : false;
typeof parent?.readonly !== "undefined" ? parent.readonly : parent.options?.readonly || false) : false;
if(readonly === true && typeof window.customElements.get(_nodeName + "_ro") != "undefined")
{
_nodeName += "_ro";

View File

@ -355,7 +355,9 @@ export class Et2Tabs extends Et2InputWidget(SlTabGroup) implements et2_IResizeab
id: tab.id,
name: tab.id,
active: active,
hidden: tab.hidden
hidden: tab.hidden,
// Set readonly so it gets passed on to children
readonly: tab.hidden
}, this);
// Tab content