Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2c93e94

Browse files
committedApr 11, 2025·
Avoid focus ping pong between editors
1 parent b3beaea commit 2c93e94

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed
 

‎CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
1111
## [Unreleased]
1212

13+
### Fixed
14+
15+
- Move focus request out of requestKeyboard to avoid focus ping pong between editors.
16+
1317
## [11.2.0] - 2025-03-26
1418

1519
### Added

‎lib/src/editor/editor.dart

+5-1
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

-2
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)
Please sign in to comment.