Skip to content

Commit

Permalink
Answer question of directionality
Browse files Browse the repository at this point in the history
Issue #1098 resolved to make the switch adapt to flow direction of scripts and render the "on" state on the left side for `rtl` and on the right side for `ltr`.
  • Loading branch information
gfellerph committed Oct 10, 2024
1 parent fe0e8cc commit 525de50
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion site/src/pages/components/switch.explainer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -525,9 +525,16 @@ The switch element can be associated with the existing `role="switch"`.
### Globalization

<div class="question">
Is thumb in the "on" position on the left in a `rtl` directional environment?
How should the switch behave in writing modes other than `horizontal-tb`?
</div>

The switch should adapt to the current text direction[^11].

| Writing mode | Direction | "on" position |
| ------------- | ------------- | ------------- |
| horizontal-tb | Right to left | left side |
| horizontal-tb | Left to right | right side |

### Security

{/* _Are there any security implications surrounding the component?_ */}
Expand Down Expand Up @@ -564,3 +571,4 @@ References:
[^8]: Elements approach resolution https://github.com/openui/open-ui/issues/702#issuecomment-1664464531
[^9]: Thumb content resolution https://github.com/openui/open-ui/issues/979
[^10]: Track content resolution https://github.com/openui/open-ui/issues/978
[^11]: Direction change resolution https://github.com/openui/open-ui/issues/1098

0 comments on commit 525de50

Please sign in to comment.