2017-05-05 38 views

回答

0

textarea似乎是一個div標籤,如果它的tabindex屬性設置爲-1,則可以關注div標籤。 試試這個

$(".emoji-wysiwyg-editor").attr("tabindex",-1).focus(); 
+0

我試過了,但不起作用 – Andreah

-1

兩個編輯應該在jquery.emojiarea.js.focus()EmojiArea_WYSIWYG必須有屬性格式hasFocus=True。晚

0

也許有一點,但我下面做的:

// Mousedown on #sendBtn submits message 
    $('#sendBtn').mousedown(function (editor) { 

     $('#sendBtn').click(); 
     // clear textArea after mousedown on #sendBtn 
     $('#chatTextarea').data("emojioneArea").setText(''); 

     // keep focus on editor after mousedown on #sendBtn 
     setTimeout(function() { 
      $("#emojioneArea").data("emojioneArea").editor.focus(); 
     }, 1) 
    }); 

沒有的setTimeout沒有奏效。不要問我爲什麼。 ;)