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
Wrong alignment behavior with Tooltip/Popover components #2500
Comments
Another case 2022-09-20.13.56.55.mp4 |
Fixed in 5.5.0 |
@rtivital For me issue still present :(
|
No idea about that, maybe some issue with floating ui. Anyway, the issue was originally about arrow position and inline tooltip, the shift of tooltip is probably unrelated. |
Hey @rtivital I think the issue is this: mantine/src/mantine-core/src/Tooltip/Tooltip.tsx Lines 153 to 154 in aa3b261
The More info: |
Thanks, @atomiks, I'll change that to zero. I remember taking this exact logic from one of the floating ui examples about 4 months, it must have been changed since then. |
I've changed empty string to |
I think it should also be done for Popover:
Another thing I discovered is if you resize the window to be narrow after it gets positioned for the first time, it can have the wrong position for subsequent renders. (Assuming the There are two fixes for that:
OR
|
I've added the same changes as in Tooltip to Popover and set width: max-content |
…osition shift in some cases (#2500)
What package has an issue
@mantine/core
Describe the bug
I like that you choose to go with Floating UI as a base for all tooltips, dropdowns, etc...
I love Floating UI, but with mantine I don't have the same behavior.
Image you have a tooltip text with approx. maximum width 450px.
Also you support responsiveness for at least 320px.
We have different behavior than expected (as in Floating UI) in this cases:
Expected behavior
Default (when free space is enough)
When free space is not enough:
Actual behavior
LINK FOR DEMO
What version of @mantine/hooks page do you have in package.json?
latest
If possible, please include a link to a codesandbox with the reproduced problem
No response
Do you know how to fix the issue
No response
Are you willing to participate in fixing this issue and create a pull request with the fix
No response
Possible fix
Refactor logic to prevent usage of direct width value (maxWidth is preferable), also I think you need to research edge cases
The text was updated successfully, but these errors were encountered: