ractive-events-tap
Find more Ractive.js plugins at ractivejs.org
Tap/fastclick event plugin for Ractive.js - eliminates the 300ms delay on touch-enabled devices, and normalises across mouse, touch and pointer events.
Pressing the spacebar while an element is focused, which would normally dispatch a click
event, is also equivalent to 'tapping' it.
tap me!
Installation
Include it from CDN...
...or install from npm...
npm install ractive-events-tap
...or download it and add it as a script tag to your page:
<!-- must go first! -->
Use as a module...
Note: previous versions of this plugin would 'self-register'. If you are using a module system such as Browserify, Webpack or RequireJS, that's no longer the case - you must explicitly register the plugin.
CommonJS
var Ractive = ; // To use the tap event with a specific instancevar ractive = el: 'body' template: myTemplate events: tap: ; // To use it with componentsMyTappableComponent = Ractive; // To make it globally available to *all* instancesRactiveeventstap = ;
AMD
;
ES6
; var ractive = el: 'body' template: myTemplate events: tap ;
<script>
tag
Use as a If you include ractive-events-tap as a script tag, it will 'self-register' with the global Ractive
object, and all Ractive instances will be able to use it.
Commands when Contributing
npm run build #compile npm run test # run chrome 55+
License
MIT