jj2422
jj2422

Reputation: 372

unable to type in textarea for firefox browser

I need to drag and drop items from one list to another, which is working fine, but in fire fox browser i cant type in textarea while in other browser I can type in text area

http://jsfiddle.net/Pxsk5/

$(function () {
    $("#contentLeft ol, #contentright ol").sortable({
        connectWith: ".connectedSortable"         
    }).disableSelection(); 
});

Thanks in advance

Upvotes: 1

Views: 1024

Answers (3)

Arun P Johny
Arun P Johny

Reputation: 388316

The root cause of the problem is FF does not support the selectstart event - so it prevents the default action of mousedown event which disables the focus on the textarea using click event.

Demo: Fiddle

Upvotes: 1

Sudhir Bastakoti
Sudhir Bastakoti

Reputation: 100175

Thats because you are calling .disableSelection() for the container which includes textarea as well, try doing:

$(function () {
    .sortable({
        connectWith: ".connectedSortable"          
    });
    $("#contentLeft ol, #contentright ol").not("textarea").disableSelection();

});

Upvotes: 1

mathielo
mathielo

Reputation: 6795

Looks like that for some reason, .disableSelection() is actually disabling the selection of the textarea in Firefox, but not in other browsers. You could opt to remove it, as it is not completely necessary for your code to work.

$(function () {
    $("#contentLeft ol, #contentright ol").sortable({
        connectWith: ".connectedSortable"         
    }); 
});

Upvotes: 1

Related Questions