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
Tooltip position not working correctly with RTL #2104
Comments
Just took a quick look at source code. I think this line is causing the problem (since it's using mantine/src/mantine-core/src/Tooltip/Tooltip.tsx Lines 110 to 111 in 73c0e3a
And this is the mantine/src/mantine-core/src/Floating/get-floating-position/get-floating-position.ts Lines 1 to 14 in 73c0e3a
|
I'm taking a look at other components and will update the list of affected components below:
I believe there should be an option (global or per component) to let develops decide if they want to swap positions based on dir or not, because when you are working on a multilingual app/website, it makes sense to swap positions based on the direction; this way, the layout and components automatically adapt to the direction, but when you are working on a RTL-only app/website, it makes the maintenance hard because of inverted positions. |
Flipping position is the correct logic – if you are building website that uses both rtl and ltr, you would want those positions flipped. The prop on theme to configure this behavior will be nice though. The arrow position is not correct, it should be fixed. |
I see... so, how can I contribute to add that prop? |
Yes, sure, feel free to send a PR, if you can also fix the arrow position for rtl that would be great |
Okay, I will take a look at the code and see what I can do! |
Fixed in 5.1.7 |
What package has an issue
@mantine/core
Describe the bug
The position of tooltip is incorrect in RTL mode. For example, choosing "Right" in RTL renders the tooltip on the left side.
LTR (correct)
RTL (incorrect)
What version of @mantine/hooks page do you have in package.json?
5.1.5
If possible, please include a link to a codesandbox with the reproduced problem
No response
Do you know how to fix the issue
No
Are you willing to participate in fixing this issue and create a pull request with the fix
Yes
Possible fix
I need to take a look at the source code.
The text was updated successfully, but these errors were encountered: