feat: add hide-label-visually prop for scale-date-picker and scale-textarea#2468
Closed
tibisabau wants to merge 2 commits intotelekom:mainfrom
Closed
feat: add hide-label-visually prop for scale-date-picker and scale-textarea#2468tibisabau wants to merge 2 commits intotelekom:mainfrom
tibisabau wants to merge 2 commits intotelekom:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds support for the hideLabelVisually prop to the scale-date-picker and scale-textarea components, allowing labels to be visually hidden while maintaining their association with the input elements for assistive technologies. This feature already exists in other Scale components like scale-text-field and scale-dropdown, and this PR extends it to these two additional components to provide consistency across the component library.
Changes:
- Added
hideLabelVisuallyboolean prop to bothscale-date-pickerandscale-textareacomponents - Implemented CSS rules to hide labels using
visibility: hiddenwhen the prop is enabled - Applied the hide-label CSS class conditionally based on the prop value
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/components/src/components/textarea/textarea.tsx | Added hideLabelVisually prop declaration and applied corresponding CSS class |
| packages/components/src/components/textarea/textarea.css | Added CSS rule to hide the label when textarea--hide-label class is present |
| packages/components/src/components/date-picker/date-picker.tsx | Added hideLabelVisually prop declaration and applied corresponding CSS class |
| packages/components/src/components/date-picker/date-picker.css | Added CSS rule to hide the label when scale-date-picker--hide-label class is present |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
|
will close due to it being duplicate of #2471 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Added support for the
hide-label-visuallyprop to bothscale-date-pickerandscale-textareacomponents. This prop allows labels to be visually hidden while remaining accessible to assistive technologies, ensuring compliance with accessibility best practices.The implementation follows the existing pattern used in other Scale components like
scale-text-fieldandscale-dropdown-select, usingvisibility: hiddenon the label element to maintain accessibility while hiding the visual representation.Closes #2441.
Checklist if Applicable