Merge pull request #676 from RaphaelKimmig/electron_focus_new_notes_only

focus NoteText only when creating new notes
pull/757/head
Laurent Cozic 2018-09-03 11:53:03 +01:00 committed by GitHub
commit 07f6a4a08b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -342,9 +342,8 @@ class NoteTextComponent extends React.Component {
this.editorSetScrollTop(1);
this.restoreScrollTop_ = 0;
// If a search is in progress we don't focus any field otherwise it will
// take the focus out of the search box.
if (note && this.props.notesParentType !== 'Search') {
// Only force focus on notes when creating a new note/todo
if (this.props.newNote) {
const focusSettingName = !!note.is_todo ? 'newTodoFocus' : 'newNoteFocus';
if (Setting.value(focusSettingName) === 'title') {