Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Summernote: set focus after initialization

Summernote gives you the option of giving focus to the editor when you create it, passing this options:

$('#summernote').summernote({
     focus: true
});

But after initialization, it seems you can't give focus to the textarea by clicking a button or similar. I've tried several ways, without success.

Anyone did that?

like image 742
lsouza Avatar asked Oct 23 '14 22:10

lsouza


People also ask

How do I set focus on Summernote?

Summernote gives you the option of giving focus to the editor when you create it, passing this options: $('#summernote'). summernote({ focus: true });

How do I customize my Summernote toolbar?

If you look on the main Summernote website as opposed to the API docs you will see a clear example, that explains how to customise the toolbar. It is on the Deep Dive page and scroll down to Custom Toolbar. It also lists the available toolbar buttons. In your toolbar you set ['style', ['bold', 'italic',...

How do I turn off drag and drop in Summernote?

You can disable drag and drop with the disableDragAndDrop option.


1 Answers

$('.summernote').summernote('focus')

ps. i want to find an angular way out .. and it works

like image 103
ice Avatar answered Sep 21 '22 15:09

ice