Click on jQuery Sortable list does not blur input

。_饼干妹妹 提交于 2019-12-03 17:04:39
$('sortable').mousedown(function(){
  document.activeElement.blur();
});

Take a look at the cancel option from the jquery-ui

   $("#sortable").sortable(cancel: 'input');

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!