Skip to content

create RemoveButton component #2260

Closed

Description

@charliepark

We discovered recently that we have some <button> elements that don't pass in a type="button" attribute/value. We do add in type="button" as a default prop in the <Button> component, but there are times where we won't want to add on the style of a <Button>.

We have a few places in the MiniTable rows where we have code like this:

<MiniTable.Cell>
    <button onClick={() => onChange(items.filter((i) => i.name !== item.name))}>
        <Error16Icon title={`remove ${item.name}`} />
    </button>
</MiniTable.Cell>

Adding a RemoveButton component that receives an onClick and title prop, but that adds type="button" automatically so we don't have to think about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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