Skip to content

Commit eea55e2

Browse files
committed
Avoid focus ping pong between editors
1 parent 65da8cb commit eea55e2

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717
- `copyWith` methods to `HorizontalSpacing`, `VerticalSpacing`, `DefaultTextBlockStyle`, and `DefaultListBlockStyle` for immutable updates of properties [#2550](https://github.com/singerdmx/flutter-quill/pull/2550).
1818
- Finnish (fi) language translation [#2564](https://github.com/singerdmx/flutter-quill/pull/2564).
1919

20+
=======
21+
### Fixed
22+
23+
- Move focus request out of requestKeyboard to avoid focus ping pong between editors.
24+
2025
## [11.4.0] - 2025-04-23
2126

2227
### Added

lib/src/editor/editor.dart

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

405405
void _requestKeyboard() {
406-
_requireEditorCurrentState.requestKeyboard();
406+
if (widget.focusNode.hasFocus) {
407+
_requireEditorCurrentState.requestKeyboard();
408+
} else {
409+
widget.focusNode.requestFocus();
410+
}
407411
}
408412
}
409413

lib/src/editor/raw_editor/raw_editor_state.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,8 +1201,6 @@ class QuillRawEditorState extends EditorState
12011201
} else {
12021202
_showCaretOnScreen();
12031203
}
1204-
} else {
1205-
widget.config.focusNode.requestFocus();
12061204
}
12071205
}
12081206

0 commit comments

Comments
 (0)