#4429 closed bug (notabug)
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
Change History (12)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
See comment by garethky.
comment:3 Changed 14 years ago by
Resolution: | invalid |
---|---|
Status: | closed → reopened |
Related ticket: #4541
comment:4 Changed 14 years ago by
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(); });
comment:5 Changed 13 years ago by
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
comment:6 Changed 11 years ago by
Milestone: | TBD → 2.0.0 |
---|
comment:7 Changed 11 years ago by
Status: | reopened → open |
---|
comment:8 Changed 11 years ago by
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).
comment:9 Changed 10 years ago by
This does not work just fine if you use items and cancel parameters: http://jsfiddle.net/jcmorris/DxkZw/1/
comment:10 Changed 10 years ago by
@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
comment:11 Changed 10 years ago by
@scott.gonzalez Including the form controls did the trick. Thank you.
comment:12 Changed 9 years ago by
$("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() {
});
Suggest using a more specific selector so that input boxes are not caught up in this.