mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
Mobile: Fixes #9502: Fix note editor crash when trying to edit text quickly after opening a note (#9581)
This commit is contained in:
parent
8ae3210378
commit
02232c0ca3
@ -1347,7 +1347,9 @@ class NoteScreenComponent extends BaseScreenComponent<Props, State> implements B
|
||||
let fieldToFocus = this.state.note.is_todo ? 'title' : 'body';
|
||||
if (this.state.mode === 'view') fieldToFocus = '';
|
||||
|
||||
if (fieldToFocus === 'title' && this.titleTextFieldRef.current) {
|
||||
// Avoid writing `this.titleTextFieldRef.current` -- titleTextFieldRef may
|
||||
// be undefined.
|
||||
if (fieldToFocus === 'title' && this.titleTextFieldRef?.current) {
|
||||
this.titleTextFieldRef.current.focus();
|
||||
}
|
||||
// if (fieldToFocus === 'body' && this.markdownEditorRef.current) {
|
||||
|
Loading…
Reference in New Issue
Block a user