Remove label for ToggleSwitch, breaks i18n
See original GitHub issueDescribe 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.
Issue Analytics
- State:
- Created a year ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
@bolinfest - no need to fork. There is a workaround you can do with the
sx
prop until we figure out our i18n/translation strategy for hard-coded strings.Closing as a workaround has been accepted.