Comments (7)
Thanks for the report
from abbr-touch.
is there something I can do about that?
from abbr-touch.
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
intoabbrTouch
? - 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.
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.
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.
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.
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)
- Make a customisable popup when tapped instead of a plain alert HOT 1
- Remove bower support HOT 1
- Add test case: Ensure <abbr> element is passed to the tap handler instead of a sub-element HOT 2
- Handler is triggered twice in Firefox HOT 2
- Prime abbr-touch tooltip element with will-change
- Factor out touch event into own repo, depend on it
- Add unit tests
- Make note of special cases/issues in readme
- Use shields.io
- <abbr> wrapped in an <a> will trigger both events
- Report that abbr-touch doesn't work on mobile safari HOT 1
- Add link to working demo
- Improve wording of package description/readme
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from abbr-touch.