Skip to content
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

Merged
merged 5 commits into from
Oct 16, 2018

Conversation

l3satwik
Copy link
Contributor

No description provided.

@l3satwik l3satwik requested a review from ritz078 October 15, 2018 10:19
@vercel
Copy link

vercel bot commented Oct 15, 2018

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

@codecov
Copy link

codecov bot commented Oct 15, 2018

Codecov Report

Merging #113 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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
Impacted Files Coverage Δ
src/components/Select.tsx 100% <ø> (ø) ⬆️
src/components/shared/OptionGroup.tsx 61.36% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 402a5d7...2b48e07. Read the comment docs.

@l3satwik l3satwik requested a review from azizhk October 15, 2018 11:04
Copy link
Contributor

@azizhk azizhk left a 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.

@l3satwik
Copy link
Contributor Author

@azizhk @ritz078 done

onApply={action("onApply")}
onClear={action("onClear")}
searchBoxProps={{
onChange: action("Search.onChange"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"searchBoxProps.onChange"

@ritz078
Copy link
Contributor

ritz078 commented Oct 16, 2018

add snapshot test.


export interface OptionGroupProps_ {
children: React.ReactNodeArray;
className?: string;
searchBox?: boolean;
onSearchBoxQueryChange?: (query: string) => void;
searchBoxPlaceholder?: string;
searchBoxProps?: Partial<SearchProps>;
Copy link
Contributor

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.

@ritz078 ritz078 changed the title clearable actions for select's search feat(Select): clearable actions for select's search and ability to pass all props of Search Oct 16, 2018
@ritz078 ritz078 merged commit d672896 into master Oct 16, 2018
@ritz078 ritz078 deleted the select-search branch October 16, 2018 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants