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

[Positioner] Support logical side prop #951

Open
mj12albert opened this issue Dec 4, 2024 · 2 comments · May be fixed by #950
Open

[Positioner] Support logical side prop #951

mj12albert opened this issue Dec 4, 2024 · 2 comments · May be fixed by #950
Assignees
Labels
component: menu This is the name of the generic UI component, not the React module! i18n internationalization

Comments

@mj12albert
Copy link
Member

mj12albert commented Dec 4, 2024

Currently to position an RTL menu this is needed:

<Menu.Positioner align="start" side={isRtl ? 'left' : 'right'}>

Which is a bit odd because align is already direction-aware

With a DirectionProvider we can easily support (additional) logical sides as well that are direction aware using the corresponding CSS property names:

top: 'inset-inline-start'
right: 'inset-block-start'
bottom: 'inset-inline-end'
left: 'inset-block-end'

Applicable to all components with a Positioner and use useAnchorPositioning: Menu, Popover, PreviewCard, Select, Tooltip

Search keywords:

@mj12albert mj12albert added the component: menu This is the name of the generic UI component, not the React module! label Dec 4, 2024
@mj12albert mj12albert linked a pull request Dec 4, 2024 that will close this issue
1 task
@mj12albert mj12albert added the i18n internationalization label Dec 4, 2024
@mj12albert
Copy link
Member Author

@vladmoroz do you think its better to follow the CSS prop name completely or is inset- unnecessary?

@mj12albert mj12albert self-assigned this Dec 4, 2024
@vladmoroz
Copy link
Contributor

I think it totally has to be without inset-, it actually makes it more confusing. Those CSS properties themselves left/right/etc. are unrelated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: menu This is the name of the generic UI component, not the React module! i18n internationalization
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants