Search code examples
javascriptjquerytwitter-bootstrapeonasdan-datetimepickerfastclick.js

Bootstrap Datetimepicker not working in Safari


I'm using eonasdan's bootstrap datetimepicker plugin for my website. My website is running in ASP.NET MVC 5, it has jQuery 1.10.2, bootstrap 3.3.6, requirejs and several other plugins. The problem I'm having is that the datetimepicker is not working properly in Safari (iphone, ipad). When I click the textbox the calendar will appear but when I click on a date it will close the calendar and won't select the date or enter it in the textbox. Its as if the area is not clickable by the touch event. I tried running the plugin in a separate application and its running fine, but for some reason it doesn't work in this website. I tried upgrading to jQuery 2 and got the same result. It doesn't throw any error or logs anything either so i have no clue whats going on. Can someone please give me some advice on how to fix this.

Here is a screenshot of the calendar:

screenshot


Solution

  • Ok I finally figured out what was the issue. The project was referencing fastclick.js and attaching it to the DOM. This was causing erratic behavior in touch events. As soon as I got rid of fastclick everything started working nicely. So be careful when using fastclick.js since it's not very reliable.