Kae Verens

unclickable inputs in sortables (and workaround)

by kae verens on Sep.28, 2009, under javascript, jquery, programming, web development

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();
  });

2 Comments for this entry

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...