-
-
Notifications
You must be signed in to change notification settings - Fork 529
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 tooltip positioning in corner cases #371
Comments
I see - it seems to happen when the mouse enters the hoverable area from outside the window. Like the top or right in the above picture. Any ideas on how to fix it? |
@hassanbot I would love it if you could take a look at this issue for a few minutes! |
Hi! Sorry for being a little slow. I'll try to take a look this weekend! Although I haven't touched JavaScript in more than a year so I might be a little rusty. |
Hello gentlemen, |
Waiting for a fix too |
Hi! Sorry for the delay, but I've finally had some time to look at this issue. The problem is that when there is no way of orienting the tooltip to be inside of the client (e.g. in a corner), the Would the desired behavior be as it was before, that the orientation remains the way it was before when a good orientation can't be found? Or maybe the tooltip should try and keep as big a part as possible inside of the client? Any opinions on this? |
I'd say we want to minimize transitions, so this would argue for the
previous behavior - the orientation remains the way it was if a good
orientation can't be found. Is this do-able while keeping the
'desiredPlace' behavior?
…On Sun, Jun 3, 2018 at 10:31 AM, Hassanbot ***@***.***> wrote:
Hi! Sorry for the delay, but I've finally had some time to look at this
issue.
The problem is that when there is no way of orienting the tooltip to be
inside of the client (e.g. in a corner), the getPosition function treats
is as though it isn't close to an edge at all. This made sense before the
concept of "desiredPlace" was introduced (#207
<#207>), since it would then
just keep its orientation the way it was before. Now, however, the position
is returned to its "desired" orientation when it can't find a good
orientation.
Would the desired behavior be as it was before, that the orientation
remains the way it was before when a good orientation can't be found? Or
maybe the tooltip should try and keep as big a part as possible inside of
the client? Any opinions on this?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#371 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AS_pnVJ2r9dCLvGBa8LcwnKIyEmWu1ucks5t4_MkgaJpZM4S-YBX>
.
|
I've made a pull request (#391) that solves this issue, and cleans up the relevant code :) With it the tooltip keeps its orientation unless it can find a better one (described a little more in depth in the PR). |
🎉 This issue has been resolved in version 3.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Tooltip won't display correctly when close to top-left and top-right corner of the browser window.
How to reproduce:
Following picture was taken from http://wwayne.com/react-tooltip/
The text was updated successfully, but these errors were encountered: