rniemeyer / knockout-sortable

A Knockout.js binding to connect observableArrays with jQuery UI sortable functionality
MIT License
547 stars 128 forks source link

Can't focus input elements with cancel option #122

Closed amitava82 closed 9 years ago

amitava82 commented 9 years ago

This is really weird, spent couple of hours to track down the issue with knockout-sortable.

I'm using cancel option to prevent sorting of certain item, works as expected. But I can't focus input/select elements that are inside ones that are sortable!

Here is the fiddle: http://jsfiddle.net/a0at9fy6/2/

Middle one has prevent class and clicking on input gets focus but not for other two.

In the example, top one is using knockout demonstrating the issue. and bottom one using jquery which works as expected.

rniemeyer commented 9 years ago

@amitava82 - it seems like maybe your fiddle got cut off. When I tried it with jQuery, I saw the same result: http://jsfiddle.net/rniemeyer/a0at9fy6/1/. You may want to try using .prevent, input for the selector.

amitava82 commented 9 years ago

Thanks! I missed a selector so it seemed it was working with jQuery. .prevent, input works fine, thanks for help!