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

Commit

Permalink
Use ckeditor API to setFocus and solve some UI issue (#870)
Browse files Browse the repository at this point in the history
* Use ckeditor API to setFocus and solve some UI issue
* SetFocus on new Note from existing note

Fixes #869 
Fixes #833
  • Loading branch information
sebastienbarbier authored and vladikoff committed Apr 3, 2018
1 parent a9125dd commit 7b9b302
Showing 1 changed file with 2 additions and 1 deletion.
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

0 comments on commit 7b9b302

Please sign in to comment.