focus on textarea with tinymce (tinymce-angular)

  angular, tinymce-5

I am using tinymce with angular (tinymce-angular). The version of tinymce seems to be 5.4.1.

There are several editor fields / textareas on the page, I would like to focus on the first one on page load. Is that possible? Either in the html, or in the ts-file.

This is how I initialize the editor:

loop…

 <editor [(ngModel)]="map.get(item.id).item"
                        [ngModelOptions]="{standalone: true}"
                        (onBlur)="itemChanged(item.id)"
                        [initialValue]="map.get(item.id).item"
                        [init]="{plugins: 'link',
          menubar: false,
          toolbar:false,
          base_url: './assets/tinymce',
          suffix: '.min',
          branding: false,
          elementpath: false,
          statusbar:false,
          height:100,
          tabindex:0,
          auto_resize:true,
          placeholder: 'Type here please',
          autoresize_bottom_margin: 10}">
                </editor>

Source: Angular Questions

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.