Hi everyone,
I'm developing a custom Perspective component that includes a data property of type array, similar to the standard Table component. I'm running into an issue regarding property persistence and am hoping someone can point me in the right direction.
The Issue:
My component's data property is configured with a default array of 3 exemplary items. When I drag the component into a View in the Designer, it populates the 3 default items perfectly. However, if I delete one of the items, save the project, close the View, and reopen it—the data property reverts to the default 3 items, acting as if the deletion never happened.
Steps to Reproduce:
-
Drag the custom component into a View.
-
Delete one of the items from the data array in the Property Editor.
-
Save the project.
-
Close and reopen the View.
-
The data property reverts to the original default state (the deleted item returns).
Component Schema:
Here is the JSON schema I am currently using:
JSON
{
"type": "object",
"properties": {
"headerColor": {
"type": "string",
"description": "",
"default": "#C0C0C0"
},
"data": {
"type": "array",
"description": "",
"default": [
{
"Item": "Laptop",
"Description": "A portable personal computer with a clamshell form factor, suitable for mobile use."
},
{
"Item": "Coffee Mug",
"Description": "A type of cup typically used for drinking hot beverages, such as coffee, hot chocolate, or tea."
},
{
"Item": "Mechanical Keyboard",
"Description": "A computer keyboard that uses individual mechanical switches for each key, known for tactile feedback."
}
]
},
"visible": {
"type": "boolean",
"default": true,
"description": ""
}
}
}
Has anyone run into this before, or is there something missing in my schema definition? I'm happy to share more details or the project source if needed.
Thanks in advance for any insights!
Best,
Muti
