Skip to content

Commit 525de50

Browse files
committed
Answer question of directionality
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`.
1 parent fe0e8cc commit 525de50

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

site/src/pages/components/switch.explainer.mdx

+9-1
Original file line numberDiff line numberDiff line change
@@ -525,9 +525,16 @@ The switch element can be associated with the existing `role="switch"`.
525525
### Globalization
526526

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

531+
The switch should adapt to the current text direction[^11].
532+
533+
| Writing mode | Direction | "on" position |
534+
| ------------- | ------------- | ------------- |
535+
| horizontal-tb | Right to left | left side |
536+
| horizontal-tb | Left to right | right side |
537+
531538
### Security
532539

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

0 commit comments

Comments
 (0)