Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

(Chips): Chip properties handleSelect/handleRemove/handleInteraction are never called when Chip is child of ChipSet #650

Closed
@mgr34

Description

@mgr34

<ChipSet> calls renderChip which overwrites the handleSelect, handleInteraction, and handleRemove properties of the <Chip/>. As a result they are never called. ChipSet should either create a new function which calls both ChipSet's and Chip's handle[Select|Interaction|Remove] function. Or have ChipSet accept its own handle[Select|Interaction|Remove] function as a prop.

My inclination is to pursue option one. This may cause less breakage. The benefit of option two is that when writing <Chip/> a user wouldn't need to pass a handler to each chip, but just once on a <ChipSet/>. However, the ChipSet interface already has a handleSelect property with a different signature. A user would may need to refactor every usage of ChipSet. Whereas, having renderChip create a new function which not require any changes from a users perspective.

...also I have a PR ready to go for option one ;)

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