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

Multiselect component #354

Merged
merged 14 commits into from
Dec 1, 2021
Merged

Multiselect component #354

merged 14 commits into from
Dec 1, 2021

Conversation

sahariko
Copy link
Contributor

@sahariko sahariko commented Nov 23, 2021

Main Change

Add support for multiple values to our <Dropdown> component, via the following new props:

  • multi - When passed, will render selected options as chips.
  • multiline - When passed, and the component is constrained with a specific width, will cause it to drop line instead of displaying a counter of unrendered chips.
  • onOptionRemove - Will be called whenever a chip’s “X” is clicked.
  • onOptionSelect - Will be called whenever an option is clicked inside the menu.
  • onClear - Will be called whenever the generic clear button is clicked.

image

Additional Changes

Infrastructure

<Dropdown>

  • Separate test driver to its own file.
  • Remove unused (and non-existent) isOpen prop from <Menu>.

<Chips>

  • Enable rendering without animations (looks bad in the context of multiselect).
  • Support passing data-testid.

<Counter>

  • Enable rendering without animations (looks bad in the context of multiselect).
  • Support new onMouseDown prop, needed to prevent <Dropdown> from opening the menu when the counter is clicked.

<Dialog>

  • Fix bug with open prop, which caused it to be “ignored” when the component’s internal state changes.
  • Move default tooltip arrow styling from <Tooltip> to this component.

<Icon>

  • Support passing data-testid.

@sahariko sahariko self-assigned this Nov 23, 2021
@sahariko sahariko merged commit c0a1736 into master Dec 1, 2021
@sahariko sahariko deleted the multiselect-component branch December 1, 2021 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants