1 year ago
#380684
ChrisR
AutoFocus - Blazor - TinyMCE
I am using the Blazor version of TinyMCE and I wish to set Autofocus.
When I understand the documentation then I should set "The value of an editor instance id".
<Editor Id="txtEditor"
@bind-Value="content"
JsConfSrc="sample"
ApiKey="empty" />
and my Javascript as follow:
window.sample = {
height: '100%',
menubar: false,
selector: 'textarea',
**auto_focus: 'txtEditor',**
plugins: [
'advlist autolink lists link image charmap print preview anchor',
'searchreplace visualblocks code fullscreen',
'insertdatetime media table paste imagetools wordcount'
],
toolbar: [{ name: 'history', items: ['undo', 'redo'] },
{ name: 'styles', items: ['styleselect'] },
{ name: 'other', items: ['table', 'editimage', 'link', 'image', 'insertdatetime'] },
{ name: 'formatting', items: ['bold', 'italic'] },
{ name: 'lists', items: ['numlist', 'bullist'] },
{ name: 'alignment', items: ['alignleft', 'aligncenter', 'alignright', 'alignjustify'] },
{ name: 'indentation', items: ['outdent', 'indent'] },
{ name: 'last', items: ['fullscreen'] }
],
branding: false,
elementpath: false
}
Unfortunately it does not auto focus. Could you kindly assist?
Regards,
Chris
blazor
tinymce
0 Answers
Your Answer