Backbone.js click event doesn't work with touch

后端 未结 8 1819
-上瘾入骨i
-上瘾入骨i 2020-12-16 02:46
events: 
    \'click\' : \'select\'

When using this event on Mobile Safari the event gets triggered twice when touched. Is this a known bug or some

8条回答
  •  再見小時候
    2020-12-16 03:05

    I have used Modernizr to detect the touch device and used following code and this worked for me.

    events :function(){ 
       return Modernizr.touch ? 
         {
             "touchstart #edit" : "openEdit",
         }: 
         {
             "click #edit" : "openEdit",
         }
     }
    

提交回复
热议问题