-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix: update listbox titleText proptypes to match Dropdown #7785
Conversation
@@ -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]), |
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.
I believe a string will still be considered a node
and not throw any warnings
titleText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), | |
titleText: PropTypes.node, |
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.
it was lifted directly from the dropdown but I updated them all across the board
Deploy preview for carbon-elements ready! Built with commit 053f611 |
Deploy preview for carbon-components-react ready! Built with commit 053f611 https://deploy-preview-7785--carbon-components-react.netlify.app |
759656c
to
053f611
Compare
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.
LGTM 👍 ✅
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