carbon-design-system / carbon

A design system built by IBM
https://www.carbondesignsystem.com
Apache License 2.0
7.86k stars 1.82k forks source link

Select - `size` is not required, yet does not have default value & generates warnings #6076

Closed jendowns closed 4 years ago

jendowns commented 4 years ago

Detailed description

The size prop in the Select is not marked required, yet it does not have a default value.

If you attempt to use Select without specifying a value for the size prop -- that is, if you are trying to use a regular-sized Select -- you will get a lot of propType warnings in your developer console.

Steps to reproduce

Just use Select in development, and don't pass it a size value (as if you are trying to use a non small, non x-large Select).

See this example & view the console: https://codesandbox.io/s/agitated-sunset-cfvxs?file=/src/App.js

81719802-22747a80-9443-11ea-8f47-11f22b9e49d1

tw15egan commented 4 years ago

Any idea why the warning does not throw when using our components rather than the security implementation?

https://codesandbox.io/s/stoic-mestorf-rsvux?file=/src/App.js

jendowns commented 4 years ago

@tw15egan I'm not sure πŸ€” it's not much of an implementation though. It's imported & exported here: https://github.com/carbon-design-system/ibm-security/blob/dev/src/components/Select/index.js

jendowns commented 4 years ago

@tw15egan AH wait a second, we are on version 7.10.0 πŸ‘€ I don't believe the error is present in 7.11.3 because it's been fixed since then πŸ˜†

Thanks for looking into this -- I'm going to close out this issue as I think we need to update on our end to stop seeing this error πŸ‘

tw15egan commented 4 years ago

πŸ˜…phew! I was really hoping this was solved for good πŸ™