fix: regain focus after navigation arrows are used #878
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Solves:
#5491
#5548
#6211
The core issue is that the find
InputField
loses focus after match navigation keys are pressed.Let me explain:
The find
InputField
has listens forEnter
key press and navigates to the next found match.Thus if the user were to find some text and keep pressing
Enter
then there will be no problem.But
the main problem occurs when the user presses one of the navigating keys button, which causes the
InputField
to lose focus.And when the input field loses focus, pressing
Enter
orReturn
causes the editor to delete the selection instead of navigating to the next match.Thus this PR applies a workaround where the
InputField
gains focus even after navigating keys are pressed.There is the third case where, the user deliberately makes a selection in the document and then pressing
Enter
should ideally modify the document.