Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[select] feat(MultiSelect2): 'onClear' prop renders clear button #5361

Merged
merged 1 commit into from
Jun 7, 2022

Conversation

adidahiya
Copy link
Contributor

Changes proposed in this pull request:

Before this change, we rendered a "clear" button in the MultiSelect2 example in the docs with a custom element supplied through tagInputProps={ rightElement: ... }.

This functionality should be provided out of the box, as it's a common use case. So I've added that here in this PR.

The clear button is enabled when an onClear callback prop is defined, and omitted when that prop is undefined. It doesn't make much sense to render a button when it's not hooked up to do anything.

Reviewers should focus on:

No regression from existing behavior in docs

@adidahiya adidahiya changed the title [select] feat(MultiSelect2): new prop 'onClear' renders clear button [select] feat(MultiSelect2): 'onClear' prop renders clear button Jun 7, 2022
@adidahiya adidahiya merged commit f07320d into develop Jun 7, 2022
@adidahiya adidahiya deleted the ad/multiselect-clear-button branch June 7, 2022 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants