ractivejs / ractive-events-tap Goto Github PK
View Code? Open in Web Editor NEWTap/fastclick event plugin for Ractive.js
Home Page: http://ractivejs.github.io/ractive-events-tap/
License: MIT License
Tap/fastclick event plugin for Ractive.js
Home Page: http://ractivejs.github.io/ractive-events-tap/
License: MIT License
Maybe related to: #1 ?
I have a handler that handle a tap event
and I want to prevent the click to do the action
<a href="http://www.google.ca" title="google" on-click="register:1">click here</a>
<a href="http://www.google.ca" title="google" on-tap="register:1">tap here</a>
<script>
ractive.on('register', function(event){
event.original.preventDefault()
alert('YO');
return false
})
</script>
If i use click event, i'm not redirected to google
but I am within the tap event (on ie11)
The event object provides an "index" property as well which give the index of the item (if in an each block). It would be nice to have that property included in the "tap" event as well.
You can get from the keypath, but then string manipulation :(
Hi, I am using ractive-ractive
and ractive-events-tap
together. The only way I can get the tap event to work is to change its package.json
to:
{
"peerDependencies": {
"ractive": "> 0.5.5"
}
}
The package.json
currently states ^[email protected]
. Is that actually the lowest possible version?
This means if I have children that I don't want to be caught inside of the tap I cannot exit because node ALWAYS returns the parent, I never can get the actual targeted element for determining whether this should be ignored or not.
The package.json says it's version 2.0.0
, but it's not yet published. Can someone publish it, please?
I am using ractive on a page to render some dynamic content; this page has a bunch of other plugins, including custom ones, jQuery, and Zurb Foundation Sites. The trouble is, many plugins, including Foundation, have a "live listener" - like this one:
$(document).on('click.zf.trigger', '[data-open]', function() {
triggers($(this), 'open');
});
This event is never fired on elements that have an on-tap
attribute because of this line:
event.preventDefault(); // prevent compatibility mouse event
Not sure what the best solution is if there are compatibility issues (would be interested in understanding what exactly those were). For my project, I'm simply commenting it out.
There are errors on http://ractivejs.github.io/ractive-events-tap
$ bower install ractive-events-tap --save
bower ENOTFOUND Package ractive-events-tap not found
I doubt you have published it yet. Any chance to do so asap?
Hi,
Using the latest version of Ractive (0.9.0) this plugin is not working anymore when adding a parameter after the function name:
on-tap="function:parameter"
Can you please have a look into this? Thanks a lot!
Best regards,
Roman
For some odd reason, ractive-events-tap is broken on MS Edge.
Debugging has led me to ractive-events-tap.umd.js:70
and ractive-events-tap.umd.js:73
as being the source of the problem, but it seems that the "click" event from MS Edge returns a value for event.pointerId
where as the mouseup
event does not have this value. This is leading to the issue where it never fires the event handler.
Changing the event on line 115 from
this.node.addEventListener( 'click', handleMouseup, false );
to
this.node.addEventListener( 'mouseup', handleMouseup, false );
Solves this issue.
The alternative is to ignore the condition if one of the pointerIds is falsey. But I'm not aware of what the sideeffects might be.
Any advice?
Chromium 54.0.2840.99 (64-bit) says:
Navigator.pointerEnabled is a non-standard API added for experiments only. It will be removed in near future.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.