标签在jqtouch中无法点击

问题描述:

使用以下代码我无法点击jqtouch中的标签(在iphone模拟器和iphone本身上):

With following code I can not click on labels in jqtouch (on iphone simulator and iphone itself):

<ul class="rounded">
  <li>
    <label for="user_name">Name</label>
    <input type="text" name="user_name" id="user_name"/>
  </li>
</ul>

它在safari中运行良好,我也在jquery-mobile的演示中检查了它,它是在iphone模拟器上工作,所以问题接缝严格按照jqtouch。

It is working well in safari, I have checked this also in demo of jquery-mobile and it is working on iphone simulator, so problem seams to be strictly jqtouch specific.

感谢@Ivan我找到了更好的解决方案:

thanks to @Ivan I found better solution:

  $('label[for],input[type="radio"]').bind('click', function(e) {
    e.stopPropagation();
  });

此外它还修复了单选按钮。

Additionally it fixes radio buttons.

唯一的缺点是 - 它会停止传播,但在我的情况下它是可以的。

The only downside is - it stops propagation, but in my case it is ok.