Skip to content

fix(ui-library): toggle switch label issues #1234

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

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

ashk1996
Copy link
Contributor

@ashk1996 ashk1996 commented Feb 28, 2025

closes #778 and closes #1158

ashk1996 and others added 4 commits February 17, 2025 12:20
* fix(ui-library): remove gap to the left of the checkbox control

* fix(ui-library): icon render function revised

* fix(ui-library): checkbox component fixed with no bugs

* fix(ui-library): eslint bug fixes

* fix(ui-library): eslint bug
@ashk1996 ashk1996 added 🦹 needs:reviewers (code) The issue or pull request needs additional code reviewers 🦹 needs:reviewers (design) The issue or pull request needs additional design reviewers labels Feb 28, 2025
@ashk1996 ashk1996 changed the title Fix/1158 toggle switch label issues fix(ui-library): toggle switch label issues Feb 28, 2025
Copy link
Contributor

@thrbnhrtmnn thrbnhrtmnn left a comment

Choose a reason for hiding this comment

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

Hey @ashk1996 ,
here are my findings:

  • it seems like the toggle has some space to the right, which is not needed:
    toggle. I think we should remove this.
  • Also, where does the width of the label of 180 px come from? [Bug]: ToggleSwitch - Label issus #1158 says it should come from the parent container. For me it seems to now be hardcoded into the component, which should not be the case. We should almost never use hardcoded values. All values should come from tokens.

The a11y issues have been solved, for this ticket I do not have any findings :-)

@ashk1996 ashk1996 requested a review from thrbnhrtmnn March 14, 2025 15:33
@thrbnhrtmnn
Copy link
Contributor

Hey @ashk1996 ,

thanks for the changes, the space to the right of the toggle control is gone 😊

For the width of the label container I still have some findings:

  • I see that in the toggle-content-col div there is a min and a max width defined. Are these tokens that we have in design as well? From my understanding these are not needed and actually cause some unwanted behaviour. In design the component width is defined by the parent container, so if I place the component in a div with 200 px width, the width of the toggle component should also be 200 px. Regardless how long the label is, the toggle control should then always be right aligned and the label should be left aligned. If the label gets too long for the available space, it should linebreak.

I think a short call would help to clarify the behaviour. Could you schedule something for next week?

@thrbnhrtmnn
Copy link
Contributor

Hey @ashk1996 ,
thanks for the update. I found one small thing: when hasStateLabel=false, the Control Element should always be vertically center aligned. Currently, if we have a long label and thus the height of the component grows, the control stays top-aligned, which is not according to design.

Current behaviour:
Bildschirmfoto 2025-04-09 um 14 36 05

Expected behaviour:
Bildschirmfoto 2025-04-09 um 14 37 46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🦹 needs:reviewers (code) The issue or pull request needs additional code reviewers 🦹 needs:reviewers (design) The issue or pull request needs additional design reviewers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: ToggleSwitch - Label issus ToggleSwitch - fix accessibility violations
3 participants