You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
findController.nextMatch() works only, if the editor does not have the focus. This makes it impossible to implement the following feature: pressing some kind of shortcut to jump to the next match while editing the text (like Ctrl+K in IntelliJ) won't work.
To Reproduce
Add a shortcut to the editor which is bound to an Intent triggering a findController.nextMatch().
Perform a find operation
Set the focus on the editor and press the named shortcut from 1
Nothing happens
Expected behavior
We should navigate to the next match in that case.
Analysis
The reason nothing works is the following code:
/// File _code_editable.dart
void _onCodeFindChanged() {
final CodeFindValue? value = widget.findController.value;
if (value == null) {
widget.focusNode.requestFocus();
return;
}
/// -> prevents further processing. Why is this check necessary? Is it to avoid unintended onCodeFindChanged actions? Can we
/// avoid those using a different check?
if (widget.focusNode.hasFocus) {
return;
}
Device:
OS: Windows Desktop
The text was updated successfully, but these errors were encountered:
When you open the find panel and focus on find keyword input field, the editor will lose the focus. The shortcuts should bind to the focus of keyword input field rather than the editor.
Thank you very much for the clarification. I had another use case in mind (the user wants to step on to the next search result, when the find panel is closed). I found a work around in the meanwhile however to implement this functionality.
Describe the bug
findController.nextMatch() works only, if the editor does not have the focus. This makes it impossible to implement the following feature: pressing some kind of shortcut to jump to the next match while editing the text (like Ctrl+K in IntelliJ) won't work.
To Reproduce
Expected behavior
We should navigate to the next match in that case.
Analysis
The reason nothing works is the following code:
Device:
The text was updated successfully, but these errors were encountered: