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

fix: update listbox titleText proptypes to match Dropdown #7785

Conversation

emyarod
Copy link
Member

@emyarod emyarod commented Feb 11, 2021

Closes #7779

This PR updates the ComboBox titleText prop definition to support nodes in addition to strings. This increases the parity between the listbox components

Testing / Reviewing

Confirm no proptype warnings are emitted when adding rich content to a ComboBox title

@@ -191,7 +191,7 @@ export default class ComboBox extends React.Component {
* Provide text to be used in a `<label>` element that is tied to the
* combobox via ARIA attributes.
*/
titleText: PropTypes.string,
titleText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
Copy link
Member

Choose a reason for hiding this comment

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

I believe a string will still be considered a node and not throw any warnings

Suggested change
titleText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
titleText: PropTypes.node,

Copy link
Member Author

Choose a reason for hiding this comment

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

it was lifted directly from the dropdown but I updated them all across the board

@netlify
Copy link

netlify bot commented Feb 11, 2021

Deploy preview for carbon-elements ready!

Built with commit 053f611

https://deploy-preview-7785--carbon-elements.netlify.app

@netlify
Copy link

netlify bot commented Feb 11, 2021

Deploy preview for carbon-components-react ready!

Built with commit 053f611

https://deploy-preview-7785--carbon-components-react.netlify.app

@emyarod emyarod force-pushed the 7779-update-combobox-proptypes branch from 759656c to 053f611 Compare February 11, 2021 21:38
@emyarod emyarod changed the title fix(ComboBox): update titleText proptype to match Dropdown components fix: update listbox titleText proptypes to match Dropdown Feb 11, 2021
Copy link
Member

@tw15egan tw15egan left a comment

Choose a reason for hiding this comment

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

LGTM 👍 ✅

@andreancardona andreancardona enabled auto-merge (squash) February 11, 2021 21:52
@andreancardona andreancardona merged commit e94ecb7 into carbon-design-system:master Feb 11, 2021
@emyarod emyarod deleted the 7779-update-combobox-proptypes branch February 18, 2021 17:11
This was referenced Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ComboBox: Support node in titleText attribute
3 participants