0

I am using jquery-tokeninput.

On mobile devices, when trying to add a token, a keyboard should open up, but the keyboard only opens when touching/clicking/focusing on $(".token-input-input-token-facebook") and not on $(".token-input-list-facebook") (using the Facebook theme).

I have tried doing:

$(".token-input-list-facebook").live('click', function(e){
  e.preventDefault();
 $(".token-input-input-token-facebook").focus();
});

but that didn't work (along with other variants).

The html is:

<ul class="token-input-list-facebook">
<li class="token-input-input-token-facebook">
<input type="text" autocomplete="off" id="token-input-change_tags" style="outline: none; width: 30px;">
<tester style="position: absolute; top: -9999px; left: -9999px; width: auto; font-size: 14px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 400; letter-spacing: 0px; white-space: nowrap;">
</tester>
</li>
</ul>

Is there a solution for this?

4

1 回答 1

0

我最近遇到了一个非常相似的问题。我想问一下,你是不是偶然使用了fastclick?

FastClick 和 tokeninput 似乎不能很好地配合使用。

我在所有 tokeninput 字段上禁用了 FastClick,它似乎更快乐。

我通过手动创建这样的类列表来使用 facebook 主题完成此操作:

   settings = 
    classes :  
      tokenList: "token-input-list-facebook needsclick",
      token: "token-input-token-facebook needsclick",
      tokenReadOnly: "token-input-token-readonly-facebook needsclick",
      tokenDelete: "token-input-delete-token-facebook needsclick",
      selectedToken: "token-input-selected-token-facebook needsclick",
      highlightedToken: "token-input-highlighted-token-facebook needsclick",
      dropdown: "token-input-dropdown-facebook needsclick",
      dropdownItem: "token-input-dropdown-item-facebook needsclick",
      dropdownItem2: "token-input-dropdown-item2-facebook needsclick",
      selectedDropdownItem: "token-input-selected-dropdown-item-facebook needsclick",
      inputToken: "token-input-input-token-facebook needsclick",
      focused: "token-input-focused-facebook needsclick",
      disabled: "token-input-disabled-facebook needsclick"

这告诉 FastClick 忽略所有令牌输入行为,并导致选择和编辑按预期工作。

于 2014-06-23T16:02:30.113 回答