-
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(Select): clearable actions for select's search and ability to pass all props of Search #113
Conversation
This pull request is automatically deployed with Now. |
Codecov Report
@@ Coverage Diff @@
## master #113 +/- ##
=======================================
Coverage 74.01% 74.01%
=======================================
Files 68 68
Lines 812 812
Branches 157 157
=======================================
Hits 601 601
Misses 196 196
Partials 15 15
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.
Just add searchBoxProps and pass it on to the search box.
stories/select.story.tsx
Outdated
onApply={action("onApply")} | ||
onClear={action("onClear")} | ||
searchBoxProps={{ | ||
onChange: action("Search.onChange"), |
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.
"searchBoxProps.onChange"
add snapshot test. |
|
||
export interface OptionGroupProps_ { | ||
children: React.ReactNodeArray; | ||
className?: string; | ||
searchBox?: boolean; | ||
onSearchBoxQueryChange?: (query: string) => void; | ||
searchBoxPlaceholder?: string; | ||
searchBoxProps?: Partial<SearchProps>; |
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.
so I don't know how feasible and maintainable two props dependent on one another.
export type OptionGroupProps_ = {
className?: string;
... // others
} & {
searchBox: true;
searchBoxProps: SearchProps
}
Such that it determines that if searchBox is true, searchBoxProps is defined and contains required props of SearchProps.
Don't do this now as there is some bug as it will ask you to add default props in searchBoxProps even though React adds them on its own. Just keep this in mind when you need two keys dependent on one another.
No description provided.