Skip to content

Allow defaults for list-item DropIndicator Instruction #209

@joshkel

Description

@joshkel

The new list-item DropIndicator is (I assume) designed to get its instructions from the list-item hitbox, which provides a complete Instruction object. However, the Instruction type makes it more awkward to use directly (apart from the hitbox):

export type Instruction = {
    [TOperation in Operation]: {
        operation: TOperation;
        blocked: boolean;
        axis: Axis;
    };
}[Operation];

return <DropIndicator instruction={{ type: 'combine', axis: 'vertical', blocked: false }} />;

Could the types be relaxed to provide more defaults?

export type Instruction = {
    [TOperation in Operation]: {
        operation: TOperation;
        blocked?: boolean; // defaults to false
        axis?: Axis; // defaults to 'vertical', just like hitbox
    };
}[Operation];

return <DropIndicator instruction={{ type: 'combine' }} />;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions