Skip to content
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

Answer question of directionality #1105

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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`?
Copy link
Member

Choose a reason for hiding this comment

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

Since you have an answer to the question, please remove the question

Copy link
Member

Choose a reason for hiding this comment

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

That said, we didn't resolve on the vertical scenario so there should probably be a new question elsewhere (maybe replace this text) and open a new issue and link to that one.

</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