-
Notifications
You must be signed in to change notification settings - Fork 934
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(actions): add clear items action #187
feat(actions): add clear items action #187
Conversation
Codecov Report
@@ Coverage Diff @@
## master #187 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 4 4
Lines 277 278 +1
Branches 65 65
=====================================
+ Hits 277 278 +1
Continue to review full report at Codecov.
|
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.
Thanks! LGTM! What do you think @tansongyang?
README.md
Outdated
@@ -452,6 +452,7 @@ These are functions you can call to change the state of the downshift component. | |||
| property | type | description | | |||
|-------------------------|------------------------------------------------------------------|------------------------------------------------------------------------------| | |||
| `clearSelection` | `function(cb: Function)` | clears the selection | | |||
| `clearItems` | `function()` | clears the items | |
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.
Could the description be more helpful:
Clears downshift's record of all the items. Only really useful if you render your items asynchronously within downshift. See [#186](https://github.com/paypal/downshift/issues/186)
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.
Yes, it is!
@@ -1,89 +1,112 @@ | |||
import * as React from 'react'; |
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 guess kcd-scripts
is working 😅
We're now applying prettier to ts
files! 🎉
Yeah, I think the TS definition for |
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.
Terrific! Thanks!
What:
Solves #186
Why:
No way to clear tracked items from children.
How:
Added
clearItems
as property method which setsthis.items = []
Checklist: