2017-05-05 34 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没有奏效。不要问我为什么。 ;)