Array of struct auto expands on add of a nested Array

Arrays of structs expand unexpectably in some cases. One that has been clearly identified is when we use the filter search.

This is annoying as the re-expansion of the array makes editing these array very hard.

Is there a fix incoming? Thanks

[Attachment Removed]

Steps to Reproduce

  1. Create a USTRUCT “MyStruct” with only a property “MyArray” : a TArray<int32>
  2. Create a UObject “MyObject” with a UPROPERTY “MyStructArray” : a TArray<MyStruct>
  3. Compile/Run Editor
  4. Create a blueprint with parent class “MyObject”.
  5. In the details view : add 2 entries to MyStructArray.
  6. Collapse all MyStructArray
  7. Expand the index 1
  8. Add an entry to MyArray
  9. Notice if the array MyStructArray expanded automatically or not
  10. Add a filter in the search bar of the detail view : enter “MyArray”
  11. repeat steps 6 to 9
  12. Notice that the array MyStructArray is fully expanded.

[Attachment Removed]

Hi,

Sorry for the delay here; I’ve got a shelved CL that should address this specific scenario, you can take a look at CL#59230587 if you’re curious to try it yourself. It may take a bit of time for the team to review that (since we need to make sure it plays nicely with some other detail panel expansion changes that have gone in recently), but I’ll post back once those changes are checked in.

Best,

Cody

[Attachment Removed]

Sorry about that, this is now submitted at CL#59363466. Let me know if you still have trouble viewing it!

[Attachment Removed]

Ah, this fix should handle the case where you add a property to the inner array (the struct member) but it looks like we still get a full expansion when a new entry is added to the outer array of structs; is that what you’re seeing as well? I’ll take a look at that next week to see how heavy of a lift it is, though I wouldn’t be surprised if there are other edge cases.

[Attachment Removed]

Hi,

I’ve checked in some additional fixes at CL#59521948. Let me know how that works, hopefully that covers more of the potential cases here!

[Attachment Removed]

Hi Cody

Thanks for your answer

I don’t seem to be able to view your personal CL

Let me know when this would be submitted eventually

[Image Removed]

[Attachment Removed]

Hi

Thanks a lot ! I tested it

And it still doesn’t provide the expected behavior on this repro:

in an Array of struct

use a filter to find the property (use part of its name)

Collapse it

Press the + to add an entry

Notice all entries are deployed now

Thanks again

[Attachment Removed]

yes exactly

Thanks for looking into it :slight_smile:

And yes definitely, other edge cases can exist most likely

[Attachment Removed]