Skip to content

Default UIListLayout SortOrder property #443

Description

@Judash399

In Fusion, you very often make components parented to an instance alongside a UIListLayout to automatically place each one after the other instead of hardcoding position values:

[Children] = {
    scope:New "UIListLayout" {},
    scope:Object {
        Name = "Foo"
    },
    scope:Object {
        Name = "Bar",
    },
    scope:Object {
        Name = "Baz",
    }
}

Intuitively, most developers would expect the order of these components to be {Foo, Bar, Baz}, but because of the naming of each component, the order would actually be {Bar, Baz, Foo}. This is because, by default, UIListLayout's SortOrder property defaults to Name.

I suggest we make the default for SortOrder be Enum.SortOrder.LayoutOrder to provide the expected behavior in most situations. And if this behavior is not desired, you can always override it.

Another reason this is more intuitive is that when manually creating a UIListLayout in Studio (without scripts), it also defaults to Enum.SortOrder.LayoutOrder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions