Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Use ckeditor API to setFocus and solve some UI issue #870

Merged
merged 2 commits into from
Apr 3, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/sidebar/app/components/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Editor extends React.Component {
customizeEditor(editor);

// Focus the text editor
document.querySelector('.ck-editor__editable').focus();
this.editor.editing.view.focus();

editor.document.on('change', (eventInfo, name) => {
// Cache update event in case of multi-change event (copy pasting trigger many).
Expand Down Expand Up @@ -75,6 +75,7 @@ class Editor extends React.Component {
if (!this.delayUpdateNote) { // If no delay waiting, we apply modification
this.ignoreChange = true;
this.editor.setData(nextProps.note.content || '<p></p>');
this.editor.editing.view.focus();
}
}
}
Expand Down