点击 jQuery 可排序列表不会模糊输入
我可以通过单击页面上除 jQuery 可排序列表之外的任何位置来模糊输入。我该如何解决这个问题? UPD:演示
I can blur my input by clicking anywhere on the page except the jQuery Sortable list. How can I fix this?
UPD: demo
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
看看 jquery-ui 中的 cancel 选项,
您必须将其删除
$("#sortable").disableSelection();
请参阅我的 jsfiddle
更新
我理解您的问题。因为 jQuery 在对列表进行排序时会停止浏览器的默认功能,所以永远不会对该字段调用模糊。你必须迫使场变得模糊。
请参阅我的 jsfiddle。我使用更改来调用模糊,如果您希望模糊始终发生,您可以将“更改”更改为“开始”。
Take a look at the cancel option from the jquery-ui
You'll have to remove the
$("#sortable").disableSelection();
See my jsfiddle
UPDATE
I understand your problem. Because jQuery stops the default functionality of the browser when sorting a list, the blur is never called for that field. You'll have to force the field to blur.
See my jsfiddle. I use change to call the blur, you can change 'change' to 'start' if you want the blur to always happen.
这是jquery sortable的一个bug,将在jqueryui 2.0.0中修复。请参阅可排序:单击可排序项目不会导致表单元素模糊
It is a bug of jquery sortable, which will be fixed in jqueryui 2.0.0. See Sortable: clicking a sortable item does not cause form element to blur
将句柄限制为不是输入的特定元素为我解决了这个问题。
To limit the handle to a specific element that is not a input solved it for me.