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

[Select]: size prop defaults to empty string, but its propType does not allow that #5471

Closed
1 of 2 tasks
jendowns opened this issue Feb 27, 2020 · 1 comment · Fixed by #5473
Closed
1 of 2 tasks

Comments

@jendowns
Copy link
Contributor

jendowns commented Feb 27, 2020

What package(s) are you using?

  • carbon-components
  • carbon-components-react

Detailed description

In the latest 7.9.0 of carbon-components-react, the size prop is set to an empty string by default:

However, only sm and xl are valid size prop values:

/**
* Specify the size of the Text Input. Currently supports either `sm` or `xl` as an option.
*/
size: PropTypes.oneOf(['sm', 'xl']),
};

So the default of the size prop violates the propTypes rules, and it generates errors wherever a "default" size is used. (You can see this is you pull down master / the latest and run the React storybook environment).

@jendowns
Copy link
Contributor Author

I can help with this 👍 PR coming shortly

@jendowns jendowns changed the title [Select]: size prop defaults to empty & generates propType errors [Select]: size prop defaults to empty string, but its propType does not allow that Feb 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant