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

Incorrect rendering of tooltip #238

Open
Florian-Mt opened this issue May 1, 2024 · 0 comments
Open

Incorrect rendering of tooltip #238

Florian-Mt opened this issue May 1, 2024 · 0 comments

Comments

@Florian-Mt
Copy link

Florian-Mt commented May 1, 2024

Hello,

Workin with tooltips with the laura preset, I encountered two issues.

When a tooltip renders. the external shadow is a few pixels farther than the actual content box on vertical or horizontal axis depending on the tooltip's position. It is due to the CSS having:

    root: ({ context, props }) => ({
        class: [ 'shadow-md' ],
    }),

But the shadow-md class should better be on the text item, not root.

Secondly, when the tooltip cannot render where it should, it changes position, but the arrow still renders depending on the intended position, i.e. the position where the tooltip is actually not.

I did not find how to fix it, but I bet this part is wrong :

    arrow: ({ context, props }) => ({
        class: [
            {
                'border-y-[0.25rem] border-r-[0.25rem] border-l-0 border-r-surface-600': context?.right || (!context?.right && !context?.left && !context?.top && !context?.bottom),
                'border-y-[0.25rem] border-l-[0.25rem] border-r-0 border-l-surface-600': context?.left,
                'border-x-[0.25rem] border-t-[0.25rem] border-b-0 border-t-surface-600': context?.top,
                'border-x-[0.25rem] border-b-[0.25rem] border-t-0 border-b-surface-600': context?.bottom
            },
        ]
    }),

In that context.left | right | bottom | top seems to be the intended position but not the actual rendering position, but styles should depend on the actual position.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant