Skip to content

Remove label for ToggleSwitch, breaks i18n #2078

Description

@bolinfest

Describe the bug
A clear and concise description of what the bug is.

Creating a <ToggleSwitch> forcibly displays an "On" or "Off" label. The only documented options for statusLabelPosition are start and end. How about offering none and make it the default?

To Reproduce
Create a <ToggleSwitch>. "On" vs. "Off" is displayed to match the state of the switch.

Expected behavior
No label should be displayed. Only the application owner knows the language of the host page, the vocabulary the app is using to describe the state controlled by the switch, what font size/color should be used to be consistent with the rest of the app, etc.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: macOS
  • Browser Chrome
  • Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36

Additional context
While we're discussing the API, onClick does not seem like a great API name. It suggests the event handler is not appropriate on touch devices. I don't care whether the user used a mouse, keyboard, or their finger to toggle the state: I want one event handler where I respond to the state change that results from the input event.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions