Giter Club home page Giter Club logo

Comments (7)

usmonster avatar usmonster commented on July 22, 2024

Hi @arvgta, and thanks for opening this issue.

Can you please provide a link to a JSFiddle (or similar) that simply & reliably demonstrates the issue you experienced? Please also specify which mobiles & browsers experience the issue.

(Also, which version of the plugin are you using? The last tagged v1.8.1, or the latest version from master? This may have been fixed and could just be waiting to be tagged+released...)

Thanks for the input, and I await your demo of the issue. :)

from jquery-hoverintent.

arvgta avatar arvgta commented on July 22, 2024

Hi @usmonster,

thanks for the rapid reply. The version I was using was indeed old (2003 / 2004).
Glad to here that it may have been fixed - great!

Could you please point me to the latest version, and I will retry it in my project.

(It's cumbersome to make a fiddle with my plugin - I would just go ahead and re-integrate the latest version of hoverIntent in Ajaxify


EDIT: Just tried out the latest hoverIntent code for a new Ajaxify version - problem persists...
What is basically happening is that, e.g. in the responsive view of Chrome hoverIntent is firing after the click event, which is in turn causing Ajaxify to crash hard.

I do not have this issue with jQuery's built-in hover.

The bug has been reported to me to be on e.g. iPads, other iOS devices and some Android versions.

I would love to use hoverIntent again, because it saves a lot of bandwidth in a very intelligent way!

A quick question - is this hoverIntent call alright? ->

if (prefetch) $(selector).hoverIntent(_prefetch, function(){});

(if the second argument is not acceptable - that would explain, why the _prefetch handler is being called twice)

I'll leave the faulty version online on 4nf.org over night - as the demo you requested!

You can clearly see that everything's fine on the desktop but not so on a mobile...

Thanks for your support!

from jquery-hoverintent.

usmonster avatar usmonster commented on July 22, 2024

Hi @arvgta. Thanks for the follow-up!

It appears that the way you're calling the plugin is fine, though I really can't help fix the issue without a link to a simple demo of the bug and steps to reproduce the bad behavior.

Yes, it may be cumbersome, but bug reporters often realize that the bug is in their own code when they start to make a simple demo. Even if it's a real bug in the plugin, it's much easier to debug, identify, and fix when it's not surrounded by an entire website's worth of markup, CSS, and unrelated JS. ;) I hope you understand!

from jquery-hoverintent.

arvgta avatar arvgta commented on July 22, 2024

Hi @usmonster. Thanks for your quick response, once again!

To cut a long story short - here's the fiddle I made, with bargain-basement logic.
(Sorry, I didn't realise, how easy it is to make a fiddle - it was my first...)

Please open the console in Chrome and then toggle the device mode in the Chrome console to "responsive" prior to running the Fiddle.

What I see is, as suspected:

Normal click!
HoverIntent fired!

i.e. the normal click firing before hoverIntent

When in desktop view, everything is alright with this output:

HoverIntent fired!
Normal click!

I had a look at the hoverIntent code and must admit that there doesn't seem that much room for such an error - so I'd love to help you out, but don't know what the reason might be right now, unfortunately...

In a first step, let's agree on that the behaviour described above is not, what it should be - i.e. the output should be like on the desktop for both test scenarios?

Then I'd suggest having a look at the code together?

Thanks again!

from jquery-hoverintent.

arvgta avatar arvgta commented on July 22, 2024

Hi @usmonster, could you please indicate, whether we want to fix this issue any time soon?

from jquery-hoverintent.

usmonster avatar usmonster commented on July 22, 2024

Hi @arvgta! I didn't get to investigate in depth, but this might simply be caused by the natural event order of touch-based actions:

Basically, hoverIntent introduces a default delay after mouseenter before the callback is fired. For touch actions, there is no mouseenter event until the very moment of the touch, so it's completely normal and expected that the click happens first in this configuration. Basically, it's working as expected.

Depending upon your use case, a workaround for you might be to conditionally set the interval option to 0 when you initialize hoverIntent if you detect touch events.

It's still uncertain if touch events will ever be handled in the plugin itself, but I'll take a look at what happens with plain .hover and decide later. I'll open a new issue if we decide to fix it, but for now I'll close this one, if that's OK.

Hope this answers all your questions!

from jquery-hoverintent.

arvgta avatar arvgta commented on July 22, 2024

Hi @usmonster, thanks for elaborating on the issue. Thanks for the links, too!

From a hoverIntent user's point of view, I would still maintain, that the behaviour is not, what one would expect by default. When you test against jQuery's normal hover, you ought to find, that the behaviour is different. I understand, that it is part of the strategy of hoverIntent to have a user interface similar to hover? Ideally, the behaviour of both at run-time should be similar, too, only with hoverIntent being a bit smarter?

Thanks for the suggested workaround for my use case. I have to decide now, how to handle this irregularity, if I decide to enjoy hoverIntent in the future.

from jquery-hoverintent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.