Skip to content

Commit

Permalink
Fix bug when trying to unselect a date on IOS touch devices (iPhone, …
Browse files Browse the repository at this point in the history
…Ipod, Ipad)

Related with the issue Twipped#173
  • Loading branch information
rafaellyra committed Aug 15, 2016
1 parent fd1542b commit 4e134ad
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ var util = Kalendae.util = {
if (elem.attachEvent) { // IE only. The "on" is mandatory.
elem.attachEvent("on" + eventName, listener);
} else { // Other browsers.
elem.addEventListener(eventName, listener, false);
if(eventName === 'mousedown' && 'ontouchstart' in window || 'onmsgesturechange' in window) {
//works on touch devices
elem.addEventListener('touchstart', listener, false);
} else {
elem.addEventListener(eventName, listener, false);
}
}
return listener;
},
Expand Down

0 comments on commit 4e134ad

Please sign in to comment.