-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
[core] Rename direction
prop to dir
#831
Comments
Does this work in the first place? There seem to be two cases:
Now, case 2. likely doesn't make a lot of sense. You wouldn't release RTL partially done.
If I set So overall, the core problems seem to be that the |
Good point ~ I didn't consider this but with that in mind, what Ariakit does by separating behavior and layout makes sense1 I think we could expand on what was done in #825 and apply to all components that need to support RTL behavior:
What do you think? @oliviertassinari @vladmoroz Footnotes |
Here's an example of Ariakit's Toolbar with RTL: https://stackblitz.com/edit/vitejs-vite-jth9ne?file=src%2Fstyle.css The |
@mj12albert They say in https://ariakit.org/reference/toolbar#rtl "This only affects the composite widget behavior. You still need to set dir="rtl" on HTML/CSS.". I don't know, Ariakit API seems unintuitive. If I set |
I mean we do this without renaming our
I agree - Ariakit makes you set both |
@mj12albert I'm lost, I don't understand your last comment. What's the solution to handle the html A few ideas on the solution space, options:
|
Yes ~ after considering your point about not cluttering the DOM with
I'm proposing that components can be aware of the <html dir="rtl">
<body>
<Slider /> {/* left/right arrow keys are reversed */}
</body>
</html> This would also work, but <html>
<body>
<Slider dir="rtl" /> {/* left/right arrow keys are reversed */}
</body>
</html> Here's a demo of how this works with
a. in Firefox, where
I know Radix does this with a DirectionProvider, though both using that and using a prop on a component will set the HTML |
@mj12albert So
For a Slider, the SSR output depends on the direction, no?
Oh, I didn't know, option 2. |
We decided to rename this to
dir
to match the HTMLdir
attribute, which would help reduce a potential collisionRelevant components:
Search keywords:
The text was updated successfully, but these errors were encountered: