Skip to content

Commit d27f201

Browse files
committed
Avoid focus ping pong between editors
1 parent b3beaea commit d27f201

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/src/editor/editor.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,11 @@ class QuillEditorState extends State<QuillEditor>
396396
}
397397

398398
void _requestKeyboard() {
399-
_requireEditorCurrentState.requestKeyboard();
399+
if (widget.focusNode.hasFocus) {
400+
_requireEditorCurrentState.requestKeyboard();
401+
} else {
402+
widget.focusNode.requestFocus();
403+
}
400404
}
401405
}
402406

lib/src/editor/raw_editor/raw_editor_state.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,8 +1199,6 @@ class QuillRawEditorState extends EditorState
11991199
} else {
12001200
_showCaretOnScreen();
12011201
}
1202-
} else {
1203-
widget.config.focusNode.requestFocus();
12041202
}
12051203
}
12061204

0 commit comments

Comments
 (0)