-
Notifications
You must be signed in to change notification settings - Fork 4k
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(Dropdown): support custom search function #484
feat(Dropdown): support custom search function #484
Conversation
Current coverage is 98.62% (diff: 100%)@@ master #484 diff @@
==========================================
Files 101 101
Lines 1451 1453 +2
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 1431 1433 +2
Misses 20 20
Partials 0 0
|
@@ -134,6 +134,12 @@ export default class Dropdown extends Component { | |||
/** Define whether the highlighted item should be selected on blur */ | |||
selectOnBlur: PropTypes.bool, | |||
|
|||
/** Make the dropdown options searchable (`boolean` or `function(options, searchQuery) => filteredOptions`) */ |
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.
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.
I see. The function signature could be handy though (as long as there is no other way to see this). Do I add that temporarily to the comment, or totally not?
Something like: Make the dropdown options searchable by substring matching (default) or with a custom search function
(options, searchQuery) => filteredOptions``, or do I leave off the function signature?
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.
Your proposed description without the signature is great.
I definitely agree a signature is better than no signature. However, I want to have a consistent mechanism in place for adding them. I plan to extend the props table to handle function signatures via standardized jsdoc tags (i.e. @param
etc). I'll add an issue for this now!
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.
@levithomason I changed the comment. For consistency also added a period to the previous prop comment (forgot it before). |
Released in |
Addresses issue #469