Hiếp me
Hiếp me

Reputation: 125

how to focus textarea in kendoui draggable object?

I can't focus textarea,edit,select text,change cursorpostion of textarea in KendoUI draggable as JqueryUI "cancle" configuration

example

http://jsfiddle.net/86yTG/1/

html:

<div class="drag">
    <textarea></textarea>
</div>

css:

.drag{
    width: 300px;
    height: 200px;
    background-color: red;
}

js:

$(document).ready(function () {
    $('.drag').kendoDraggable({
        hint: function(e){
            return e.clone();
        }
    });
});

Upvotes: 1

Views: 643

Answers (1)

Jai
Jai

Reputation: 74738

You can bind a click on your textarea like this:

$(document).ready(function () {
   $('.drag').kendoDraggable({
      hint: function (e) {
          return e.clone();
      }
   }).find('textarea').on('click', function () {  //<-----add from here
      $(this).focus();
   });
});

Demo

Here you have to bind an event to the textarea to get the focus.

Upvotes: 2

Related Questions