unclickable inputs in sortables (and workaround)

Got a call today – a form I created which had some sortable elements was not allowing its contained inputs to be clicked.

After a little investigation, I found this is already reported as a bug.

The workaround is to apply the sortable as usual, using the $().sortable() call, and then after that, override the sortable’s mousedown and click events to force inputs to be selected when they’re clicked.

  $('#form_fields').sortable();
  $('#form_fields input').bind('click.sortable mousedown.sortable',function(ev){
    ev.target.focus();
  });
About verens

Comments

  1. Mickster on September 28, 2009 at 3:52 pm said:

    Already looking forward to KFM2 :)
    Keep up the good work!

    //Mickster

  2. Mickster on September 28, 2009 at 3:53 pm said:

    Sorry, left my comment to the wrong post… Where’s my coffee?! :)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>