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

issue: Tooltips are clipped on constrained containers and ExternalLink tooltip disappears when hovering over it #412

Closed
tigerros opened this issue Dec 4, 2023 · 7 comments · Fixed by #421
Assignees
Labels
bug 😔 Something isn't working

Comments

@tigerros
Copy link

tigerros commented Dec 4, 2023

  • Tooltip component overflow is clipped, which is unwanted behavior when it comes to tooltips. Bug in question:

    image

    The red lines are the padding of the black rectangle, inside of which is the ExternalLink (which uses tooltips).

  • The ExternalLink tooltips disappear when user moves their mouse to the tooltip. Very annoying. Also present in feat: Add Link component back #411

@tigerros tigerros changed the title bug: Tooltips are clipped, ExternaLink tooltip disappears when hovering over it bug: Tooltips are clipped, ExternalLink tooltip disappears when hovering over it Dec 4, 2023
@marc2332 marc2332 added the bug 😔 Something isn't working label Dec 4, 2023
@marc2332 marc2332 self-assigned this Dec 4, 2023
@marc2332
Copy link
Owner

marc2332 commented Dec 4, 2023

Weird, I thought I already fixed that, I'll take a look asap!

@marc2332
Copy link
Owner

marc2332 commented Dec 4, 2023

Tooltip component overflow is clipped, which is unwanted behavior when it comes to tooltips. Bug in question:

Mmm, I am sorry but, what is the bug? I don't understand what exactly is being clipped

@marc2332
Copy link
Owner

marc2332 commented Dec 4, 2023

Tooltip component overflow is clipped, which is unwanted behavior when it comes to tooltips. Bug in question:

Mmm, I am sorry but, what is the bug? I don't understand what exactly is being clipped

Seems to work just fine:

image

@tigerros
Copy link
Author

tigerros commented Dec 4, 2023

@marc2332 This code:

fn app(cx: Scope) -> Element {
    render! {
        rect {
            width: "100",
            padding: "30",
            background: "yellow",
            ExternalLink {
                url: "https://github.com/marc2332/freya/",
                label {
                    "Freya"
                }
            }
        }
    }
}

Produces this:

image

@marc2332
Copy link
Owner

marc2332 commented Dec 4, 2023

Ahh, I see, well, I guess that's a case I did not test.

The problem is that the tooltip doesn't have any space left. I think I could fix this by implementing viewport size units, this way I could use e.g 100vw (100% of the window width) in here, this way the Tooltip would have available space to render (It would still just take whatever size it needs, not the whole window width)

@marc2332 marc2332 changed the title bug: Tooltips are clipped, ExternalLink tooltip disappears when hovering over it issue: Tooltips are clipped on constrained containers and ExternalLink tooltip disappears when hovering over it Dec 4, 2023
@tigerros
Copy link
Author

tigerros commented Dec 4, 2023

Could the position be absolute and be set to the cursor's position? Wouldn't the tooltip ignore constraints that way?

@marc2332
Copy link
Owner

marc2332 commented Dec 4, 2023

Could the position be absolute and be set to the cursor's position? Wouldn't the tooltip ignore constraints that way?

Nope, Skia requires you to pass always a width when creating text (it makes sense, it needs to know whether to break line, where to render, etc), and Freya, even when using absolute mode, you are still constrained by your parent sizing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 😔 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants