Search and Top Navigation
#4429 closed bug (notabug)
Opened April 02, 2009 11:57PM UTC
Closed February 28, 2013 03:53AM UTC
Last modified February 26, 2015 09:26PM UTC
Can't select text in inputs within sortables
Reported by: | mikejestes | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 2.0.0 |
Component: | ui.sortable | Version: | 1.7.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Text inside a text input element cannot be selected when in a sortable area.
I have a demo here: http://mikejestes.com/demo/?demo=jquery_ui_sortable
Attachments (0)
Change History (12)
Changed April 05, 2009 06:34PM UTC by comment:1
Changed May 07, 2009 11:06AM UTC by comment:2
resolution: | → invalid |
---|---|
status: | new → closed |
See comment by garethky.
Changed May 19, 2009 05:14PM UTC by comment:3
resolution: | invalid |
---|---|
status: | closed → reopened |
Related ticket: #4541
Changed September 28, 2009 01:06PM UTC by comment:4
had the same problem myself today.
the solution (from the client-programming side) is to apply sortable to the event, then override the sortable's mouse events.
For example:
$('#form_fields').sortable(); $('#form_fields input').bind('click.sortable mousedown.sortable',function(ev){ ev.target.focus(); });
Changed June 17, 2010 02:08PM UTC by comment:5
Hey,
I have a similar pb.
In my fieldset sortable i want to unsortable an element ul insered on the fieldset .
Exemple :
<fieldset id='base'>
<ul id='panel'>
<li></li>
..
<ul>
</fieldset>
i want that when i click on my ul-panel the sortable mode was not activated, but just arond the ul.
I test : $('#form_fields').sortable();
$('#form_fields ul').bind('click.sortable mousedown.sortable',function(ev){
ev.target.focus();
});
but it's change anything.
Thanks in advance
Changed October 11, 2012 09:07PM UTC by comment:6
milestone: | TBD → 2.0.0 |
---|
Changed October 27, 2012 08:19PM UTC by comment:7
status: | reopened → open |
---|
Changed February 28, 2013 03:53AM UTC by comment:8
resolution: | → notabug |
---|---|
status: | open → closed |
This works just fine as long as you do not use disableSelection (which is deprecated and will be removed completely, see #7756).
Changed March 28, 2013 06:03PM UTC by comment:9
_comment0: | This does not work just fine if you use items and cancel parameters. \ \ http://jsfiddle.net/jcmorris/DxkZw/1/ → 1364494104114334 |
---|
This does not work just fine if you use items and cancel parameters: http://jsfiddle.net/jcmorris/DxkZw/1/
Changed March 28, 2013 06:33PM UTC by comment:10
@jmorris Well, you specifically told the sortable not to cancel on input
. You'll want to include form controls in your cancel
option: http://api.jqueryui.com/sortable/#option-cancel
Changed March 28, 2013 09:30PM UTC by comment:11
@scott.gonzalez Including the form controls did the trick. Thank you.
Changed February 26, 2015 09:26PM UTC by comment:12
_comment0: | //For disable \ $("input, select, textarea").bind('mousedown.ui-disableSelection selectstart.ui-disableSelection', function(e){ \ e.stopImmediatePropagation(); \ }); → 1424986052714210 |
---|
$("input, select, textarea").bind('mousedown.ui-disableSelection selectstart.ui-disableSelection', function(e){
e.stopImmediatePropagation();
});
Somewhere in the sample code you linked to there is a call to dissableSelection();
This is actually a method in ui.core that stops the user from using the cursor to select text. Its in the sortable examples as well:
$(function() {
$("#sortable").sortable();
$("#sortable").disableSelection(); // this will disable text selection!
});
Suggest using a more specific selector so that input boxes are not caught up in this.