-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat(autocomplete-multiple): React component and tests #194
feat(autocomplete-multiple): React component and tests #194
Conversation
…ps/design-system into feat/autocomplete-multiple
@@ -29,7 +29,9 @@ interface IChipProps extends IGenericProps { | |||
color?: Color; | |||
/* Whether the chip has pointer on hover. */ | |||
isClickable?: boolean; | |||
/** Indicates if the chip is currently in an active state or not. */ | |||
/** Indicates if the chip is currently in a highlighted state or not. */ | |||
isHighlighted?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pourquoi ajouter ça ? Le simple fait de focus la chip ne suffit pas ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non, parce qu'on perd le focus sur le text field si on fait de focus en la chip, donc l'utilisateur ne peut pas continuer à écrire dans le texte field.
6368615
to
b3a2924
Compare
Closing this one since there were several changes after this implementation. |
Note: this PR heavily depends on PR #191 , in order to merge it, we need to finish review and merge that one first.
Created a multiple autocomplete component. It provides the following functionality:
Use Cases:
Multiple Selection with keyboard and mouse navigation
![znbEL8INfv](https://user-images.githubusercontent.com/13719066/66900890-eb013500-effd-11e9-9d72-670d011cd5f8.gif)
Creating new values
![QQ5buyRZD1](https://user-images.githubusercontent.com/13719066/66900929-fe140500-effd-11e9-8b4b-7852259c766e.gif)
Deleting selected values
![FqFMH1hR4G](https://user-images.githubusercontent.com/13719066/66900943-053b1300-effe-11e9-8f15-a96e1f5c770e.gif)
Keyboard navigation
![lmUI1rkjhe](https://user-images.githubusercontent.com/13719066/66905687-9e6e2780-f006-11e9-9f4d-a13b5c951f1e.gif)
Side effects from the implementation:
Chip
now has aisHighlighted
prop that allows to set the css class into a focused state in order to allow deletion from the AutocompleteTextField
now receives a prop calledbefore
(similar to what Chip has) that allows to add a component before the input. With this, we can add the different selected chips before the input.useKeyboardListNavigation
hook in order to allow a simpler maintenance in the future, with regards to events tracked while using the hookNote: there might be some css changes needed in order to complete the component: