ui-sortable icon indicating copy to clipboard operation
ui-sortable copied to clipboard

input blur event is not calling while using ui-sortable

Open ashpareek opened this issue 9 years ago • 9 comments

In my use case i have to create editable list . But blur event on input box is not calling.

ashpareek avatar Apr 26 '16 13:04 ashpareek

Can you fork one of the provided examples on README to demonstrate your use case? For such use cases (from what I can understand till now) defining grab handler elements for each list item was proved useful. Are you using them?

Thodoris Greasidis Computer, Networking & Communications Engineer

thgreasi avatar Apr 26 '16 15:04 thgreasi

http://codepen.io/strelcov/pen/RRRWPB when I click anywhere ng-blur works, when I click on ui-sortable elements ng-blur doesn't work. Can you help with this problem?

IvanStrelcov avatar Jun 15 '16 08:06 IvanStrelcov

It seems that jquery-ui makes the sortable items un-focusable. The best workaround I found for now is to use the start option explicitly.

start: function (e, ui) {
  $('[ng-blur]').blur();
},

thgreasi avatar Jun 15 '16 09:06 thgreasi

it works , if I start to pull the item . if you just click on the sortable element ng-blur doesn't work (

IvanStrelcov avatar Jun 15 '16 10:06 IvanStrelcov

jQuery-ui probably intercepts & prevents the propagation of the mousedown event, so that it can handle the dragging.

thgreasi avatar Jun 15 '16 10:06 thgreasi

when I changed the sortable element with the span on the button ng-blur began to work , but the button is not draggable element. Can I make a button, perhaps in the options, drag and drop items?

IvanStrelcov avatar Jun 15 '16 14:06 IvanStrelcov

Try using the handle option but it will probably not work. You can also try using a label for a dummy input.

On Wed, Jun 15, 2016, 17:10 IvanStrelcov [email protected] wrote:

when I changed the sortable element with the span on the button ng-blur began to work , but the button is not draggable element. Can I make a button, perhaps in the options, drag and drop items?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/angular-ui/ui-sortable/issues/453#issuecomment-226198905, or mute the thread https://github.com/notifications/unsubscribe/ABPF1fmed1XWaO7YdYkVGboYkxTVK9FHks5qMAfrgaJpZM4IP8iB .

Thodoris Greasidis

thgreasi avatar Jun 19 '16 10:06 thgreasi

I also encountered this problem, how do you solve it?

wangwy avatar Aug 31 '16 03:08 wangwy

Let it be my shame, but I decided that using a crutch like this export default class GroupController() { constructor($element) { 'ngInject'; this.$element = $element; this.$element.on('click', () => { document.activeElement.blur(); }); } Where this.$element is the parent of droppable element

IvanStrelcov avatar Aug 31 '16 09:08 IvanStrelcov