How to Disable Auto Focus in JavaScript DOCX Editor

28 Aug 20261 minute to read

JavaScript DOCX Editor (Document Editor) is focused automatically when the page loads. To prevent the DOCX Editor from being focused automatically, set the enableAutoFocus property to false.

The following example illustrates how to disable the auto focus in DocumentEditorContainer.

let container: DocumentEditorContainer = new DocumentEditorContainer({ enableToolbar: true, height: '590px', enableAutoFocus: false });

Default value of enableAutoFocus property is true.

The following example illustrates how to disable the auto focus in DocumentEditor.

let editor: DocumentEditor = new DocumentEditor({ height: '590px', enableAutoFocus: false });

Default value of enableAutoFocus property is true.