Code Monkey home page Code Monkey logo

Comments (7)

Tyriar avatar Tyriar commented on May 27, 2024

Thanks for the report

from abbr-touch.

My1 avatar My1 commented on May 27, 2024

is there something I can do about that?

from abbr-touch.

Tyriar avatar Tyriar commented on May 27, 2024

Not off the top of my head. To clarify, are you doing this?

<abbr title="A car"><i class="fa fa-car"></i></abbr>

Answering these questions would be helpful:

  • Are you passing a customTapHandler into abbrTouch?
  • Could you also check if there are any errors in the console?
  • Also are using a touch device or touch emulation, not a mouse?

from abbr-touch.

My1 avatar My1 commented on May 27, 2024

pretty much that example fits it. I use a touch device (galaxy Note 4 with forefox)
I use the normal way with alerts
and the altert itself comes up but with no content, as in alert(""); (or however that would be expressed with js, I am not well versed in that, and that's the reason why I chose the easiest way possible....

from abbr-touch.

Tyriar avatar Tyriar commented on May 27, 2024

Reproduced it here: https://output.jsbin.com/himacagifu

The problem is happening because the touched element on which the tap handler is being called upon is the <i>, not the <abbr>. This might be a bug in https://github.com/Tyriar/touchtap-event

I'll have to do a bit of a deeper dive later on but in the meantime a work around is to use this touch handler:

abbrTouch(document.body, function (target, title, touchX, touchY) {
  var abbr = target;
  while (abbr.tagName !== 'ABBR') {
    abbr = abbr.parentNode;
  }

  // Actual handler
  alert(abbr.title);
});

Demo here:

Thanks again for reporting!

from abbr-touch.

My1 avatar My1 commented on May 27, 2024

okay seems to work, mostly, (I put it in my implementation as jsbin has the problem of not working after 90 mins if posted by anonymous, at least that's what they say) and CHromes does as it should, but FIrefox somehow gets 2 alterts.

at least thats over the portforwarding that the chrome dev tools gave me, I will try to get into the network again and try from there.

from abbr-touch.

Tyriar avatar Tyriar commented on May 27, 2024

Fixed and published the fix to npm. The issue was that Event.target was being passed into the tap handler instead of Event.currentTarget.

from abbr-touch.

Related Issues (14)

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.