Error in the inspector when filling an array

Hello!

Found the following error. I create two classes inherited from Component. Class Test1:


import
{
	Component,
	_decorator
} from "cc";

const {ccclass}=_decorator;

@ccclass("Test1")
export class Test1 extends Component
{
}

Class Test2:


import
{
	Component,
	_decorator
} from "cc";

const {ccclass}=_decorator;

@ccclass("Test2")
export class Test2 extends Component
{
}

Next, I create class Controller:


import
{
	Component,
	_decorator
} from "cc";

const {ccclass,property}=_decorator;

@ccclass("Controller")
export class Controller extends Component
{
	@property(Component)
	public components:Component[]=[];
}

I create the following structure on the scene (components added):

There should be a picture here, but new users can’t upload enough of them!

Add two empty array elements:

There should be a picture here, but new users can’t upload enough of them!

I will add a node with the Test1 component to the element with index 0:

There should be a picture here, but new users can’t upload enough of them!

Pay attention to how the element with index 1 has changed. I cannot add a node with the Test2 component there:

03

But, if I first add the component to the element at index 1:

There should be a picture here, but new users can’t upload enough of them!

Then I can already add another component:

There should be a picture here, but new users can’t upload enough of them!

And if there are more elements, then everything generally becomes sadder. You only need to add from the end. And if you need to replace something, then you need to delete everything and redo it. Is this normal behavior?

I already tried and change these lines to other options:

@property(Component)
public components:Component[]=[];

But still the same.

Checked this behavior in versions 3.5.2, 3.5.1 and 3.5.0 - the same thing. Any ideas?

Thanks for the feedback, I’ve created a new issue on the engine repository and you can follow up here: