-
Notifications
You must be signed in to change notification settings - Fork 376
feat(Select): add typeahead variants (single and multi) #1839
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
Conversation
|
PatternFly-React preview: https://1839-pr-patternfly-react-patternfly.surge.sh |
Codecov Report
@@ Coverage Diff @@
## master #1839 +/- ##
=========================================
Coverage ? 82.59%
=========================================
Files ? 621
Lines ? 6844
Branches ? 93
=========================================
Hits ? 5653
Misses ? 1151
Partials ? 40
Continue to review full report at Codecov.
|
mcarrano
left a comment
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.
This is looking good @kmcfaul The only question I have is about desired keyboard interaction. So right now, if I start typing to narrow the list and then press Enter, it acts as an escape. @jgiardino can you check this? What would you expect?
|
In the typeahead version of the select dropdown, we wrap the toggle icon on the right in a |
|
The behavior we have in the PF3 TypeAhead Select works really well, and matches what I would expect. I suggest reviewing that component and how it behaves. One behavior to check out is how the arrow keys are able to change the selected value while focus remains in the input field. The ability to switch between arrow keys and typing is pretty seamless. The way the PF3 component handles the menu keyboard interaction is different in that they use Let me know if you have any questions about this. |
9a490c8 to
df966da
Compare
|
Added multi typeahead variant |
mcoker
left a comment
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.
very nice!
|
Regarding the typeahead logic, the code is currently converting the text input to a regex to filter options. Special characters are ignored as they break the regex and would crash the page. |
…t regex parse with MDN escape s
tlabaj
left a comment
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.
Looks great. A few small things
packages/patternfly-4/react-core/src/components/Select/Select.d.ts
Outdated
Show resolved
Hide resolved
packages/patternfly-4/react-core/src/components/Select/Select.d.ts
Outdated
Show resolved
Hide resolved
|
Great job on pulling the multi-select typeahead together! Now that keyboard and screen reader stuff is off the table, here are my other comments :-)
|
mcarrano
left a comment
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.
Regarding the multi-select version, there are a few issues here with the keyboard and mouse interactions. I will leave the keyboard-only issues to the side for now, but these are the things I see.
- As I type, the list does open and filter, but after I select an item, the text string I type still remains. This is unexpected.
- If I click back into the field after I select the first item, the drop-down closes. After more testing, it looks like any time I click in the field it also toggles the state of the list. I don't expect that. My initial click into the text field should open the list. Selecting an item should close the list. Putting focus back into the field should open the list again.
- After I select the second item, I'm getting a badge that says "1 more" even though there is plenty of room to shown both selections. The "n more" badge was only intended as an overflow when there is not enough space to show all selections.
The PatternFly 3 type-ahead works well. If we can model after that I think we will be in good shape.
… on click for TA variants, clea
|
|
|
Thanks for making updates! I included some more comments below, but if any of these seem like updates for a later PR, just let me know.
The following are the differences in how attributes are defined between these implementations and core for the single select. I'm assuming the multi-select would need similar updates, but let me know if you have questions about that one.
Awesome! There are a couple of other text strings that we should expose via props if they aren't already. They are on these elements:
One more thing I notice that is really minor... The new examples have the same |
|
This is looking much better @kmcfaul ! Just a couple of additional questions/comments:
Thanks for making this change. the interaction is much better. Seems like the user should also be able to click the toggle (down arrow) itself to close the menu.
Where is this hardcoded? In the ChipGroup component? That may be a problem as that's not what I think was intended. It would be great if we could have a string like "No matches found" display in the dropdown when there is a null query result. |
…ssigned, add no results display
|
mcarrano
left a comment
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.
Approving this, and have created #1855 to address issues with ChipGroup that were raised here.
|
Your updates look great! Here are a few more minor things I noticed. Let me know if you have any concerns about getting these addressed in time.
|
tlabaj
left a comment
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.
Nice Job. Look great!
…ypeahead, update tests
mcoker
left a comment
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.
👍
|
Great job on making the updates! All the props work as expected! There are just a few minor text string updates needed to match core:
|
tlabaj
left a comment
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.
LGTM
dlabaj
left a comment
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.
Great Job!
jgiardino
left a comment
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.
Great job on this!
…, updated tests
What: adding typeahead single and multi variant
See issue: #1215, #1216