Skip to content
This repository has been archived by the owner on Jun 14, 2020. It is now read-only.

Scrolling with mouse-wheel does not reposition mouse-tracking tip #414

Closed
Tabbernaut opened this issue Oct 17, 2012 · 10 comments
Closed

Scrolling with mouse-wheel does not reposition mouse-tracking tip #414

Tabbernaut opened this issue Oct 17, 2012 · 10 comments
Assignees
Milestone

Comments

@Tabbernaut
Copy link

Using: position . target: 'mouse'.
Works fine when the mouse cursor is moved directly.

When showing a tooltip, then using the scroll wheel (while not moving the mouse itself), does not reposition tooltip to new location of cursor (relative to page).

If scrolling that way lands the cursor on a different qTip-trigger, it will show that tooltip in the old location (pre-scrollwheel-use) aswell.

Location of tooltip only changes after moving the cursor again.

qTip2 settings:
content: {
attr: 'alt'
},
position: {
target: 'mouse'
adjust: { x: 5, y: 25 },
my: 'top center'
},
show: {
delay: 250,
solo: true,
effect: false
}

@Craga89
Copy link
Contributor

Craga89 commented Nov 12, 2012

Seems to adjust properly here: http://jsfiddle.net/fDavN/5092/

@Tabbernaut
Copy link
Author

It takes two links to get the effect I'm referring to:
http://jsfiddle.net/Tabun/A8LE9/

Put the mouse on the top link, scroll down with the mousewheel so the cursor ends up on the bottom link.

The new tooltip (for the bottom link) will show up in the location where the old tooltip (for the top link) showed up, instead of repositioning to the new location of the cursor. Only when I actually move the mouse cursor (without using the scroll wheel), does it position itself relative to the new location of the mouse cursor.

It has this effect for me in Firefox, Safari, IE9, Opera (all in Win7).

Here's an illustration of what happens:
http://www.tabun.nl/tmp/qtip2_mousewheel_a.jpg - before scrolling
http://www.tabun.nl/tmp/qtip2_mousewheel_b.jpg - after scrolling with scrollwheel

@Craga89
Copy link
Contributor

Craga89 commented Nov 12, 2012

Looks like it's to do with the fact that the scrolling causes you to mouse onto the tooltip, so it doesn't register it leaving the element... must be a bug in the tracking code. I'll look into this.

@ghost ghost assigned Craga89 Nov 27, 2012
@Tabbernaut
Copy link
Author

Hmmm, it seems the issue is still there with nightly-19317041b8 (either in the fiddle or locally with updated files):
http://jsfiddle.net/Tabun/A8LE9/

I still get the behavior as displayed in the screenshots in the post above. Am I doing something wrong?

@Craga89
Copy link
Contributor

Craga89 commented Nov 29, 2012

Definitely seems to be working for me. Ensure you've cleared your cache and try again.

@Tabbernaut
Copy link
Author

The behavior looks to be browser-dependent. Cleared all local content/cache and tried with a bunch of them:

Chrome: behaves entirely as it should; definitely working.
Firefox / Safari / IE9: same behavior as before the change.
Opera: Bit strange, works correctly on first scroll, then intermittently fails to show any tooltip (if using mousewheel only).

Perhaps it's just (some) browsers being quirky?

@Craga89
Copy link
Contributor

Craga89 commented Nov 29, 2012

Unfortunately this looks to be a side-effect of the fact onl Chrome and Opera seem to fire mousemove onscroll :( and since the scroll event doesn't provide the pageX/pageY properties there's no way to determine the current mouse position.

@Tabbernaut
Copy link
Author

Okay -- not surprised that they screwed the pooch on IE, but I'd expected FF/Saf to be more sensible in this respect. I know enough, thanks.

@Craga89
Copy link
Contributor

Craga89 commented Nov 29, 2012

Actually, I figured out a cross-browser way to fix this :) Try it out and let me know!

@Tabbernaut
Copy link
Author

Tested in the browsers that had problems before:

Safari, IE9: works fine now, miniscule delay, but definitely fixed.
Opera: still same as before, as far as I can tell.

Firefox: doesn't work like Chrome/Saf/IE, but there is a change:

Initially, after mouse-scrolling so the cursor moves from one tooltip trigger to the next, the tooltip shows in the wrong place (the tooltip for trigger 2 shows in the place that the tooltip for the first trigger appeared before scrolling).

However, when scrolling again, away from the new location (in any direction), the tooltip does reposition correctly. After that, it seems to reposition correctly, until the mouse itself is moved and the initial failure repeats. Pretty weird.

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

No branches or pull requests

2 participants