Hi all, I found that when an array attribute applying a visibleif condition only hides the input fields but leaves the attribute's label visible in the Inspector UI. Here is an example code that reproduces the issue easily.
As you can see, only the string is hidden, and the array leaves its label in the inspector.
/** @enum {string} */
const Type = {
Show: 'show',
Hide: 'hide',
};
export class TestFieldVisible extends Script {
static scriptName = 'testFieldVisible';
/**
* @attribute
* @title Type
* @type {Type}
*/
type = Type.Show;
/**
* @attribute
* @title Array Feild
* @type {string[]}
* @visibleif {type === 'show'}
*/
arrayFeild = [];
/**
* @attribute
* @title String Feild
* @type {string}
* @visibleif {type === 'show'}
*/
stringFeild = ""
}
The root cause seems to be in src/editor/inspector/components/script.ts.
Inside the _updateAttributeStatus method, ArrayInput is explicitly excluded from assigning its .parent when targeting the element to be hidden.
Thanks for taking a look. 🙏
Hi all, I found that when an array attribute applying a
visibleifcondition only hides the input fields but leaves the attribute's label visible in the Inspector UI. Here is an example code that reproduces the issue easily.As you can see, only the string is hidden, and the array leaves its label in the inspector.
The root cause seems to be in
src/editor/inspector/components/script.ts.Inside the
_updateAttributeStatusmethod,ArrayInputis explicitly excluded from assigning its .parent when targeting the element to be hidden.Thanks for taking a look. 🙏