JSFiddle - React, Tailwind, and code Playground
by enyojs
JavaScript
(function() {
var preventTap = false;
enyo.dispatcher.features.push(function(inEvent) {
if (inEvent.type == "drag") {
preventTap = true;
} else if (inEvent.type == "up") {
if (preventTap) {
preventTap = false;
inEvent.preventTap();
}
}
});
})();
enyo.kind({
name: "MySample",
classes: "enyo-unselectable",
components: [
{style:"background:red; border-radius:10px; margin:10px; padding:40px; display:inline-block; color: white;", content:"Drag in or out", ontap:"tapped", name:"red"},
{name: "result"}
],
tapped: function(inSender, inEvent) {
this.$.result.setContent(enyo.now() + " " + inSender.name + " tapped");
}
});
new MySample({fit:true}).write();