Skip to content

feat(combo-box): add hideLabel prop #2153

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

Merged
merged 4 commits into from
Apr 18, 2025

Conversation

wickning1
Copy link
Contributor

Many form components have a hideLabel prop that makes the label text only show up for screenreaders. It's useful when the placeholder is descriptive enough, but it was missing from ComboBox even though ComboBox does have a placeholder. This PR adds the functionality.

Worth noting: this component uses titleText instead of labelText, which is inconsistent with (most) other components and could make hideLabel confusing. I went with hideLabel because it's more consistent with the other components and we're still literally referring to a label role in the DOM. I would hope we could change titleText to labelText in a future breaking-changes-are-ok update.

@metonym metonym changed the title add hideLabel prop to ComboBox feat(combo-box): add hideLabel prop to ComboBox Apr 18, 2025
Copy link
Collaborator

@metonym metonym left a comment

Choose a reason for hiding this comment

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

Fantastic, thank you! I added a unit test and updated the docs.

@metonym metonym changed the title feat(combo-box): add hideLabel prop to ComboBox feat(combo-box): add hideLabel prop Apr 18, 2025
@metonym metonym merged commit 436dea4 into carbon-design-system:master Apr 18, 2025
1 check passed
@metonym
Copy link
Collaborator

metonym commented Apr 18, 2025

Released in v0.89.0

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.

2 participants