Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: regain focus after navigation arrows are used #878

Merged

Conversation

MayurSMahajan
Copy link
Contributor

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 for Enter 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 or Return 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.

Copy link

codecov bot commented Sep 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.49%. Comparing base (b6bfd11) to head (58cfff2).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #878      +/-   ##
==========================================
+ Coverage   72.48%   72.49%   +0.01%     
==========================================
  Files         316      316              
  Lines       14757    14765       +8     
==========================================
+ Hits        10696    10704       +8     
  Misses       4061     4061              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MayurSMahajan
Copy link
Contributor Author

Here's video after some testing:

2024-09-08.12-36-41.mp4

@LucasXu0 LucasXu0 merged commit 2110fde into AppFlowy-IO:main Sep 8, 2024
10 of 12 checks passed
@MayurSMahajan MayurSMahajan deleted the fix_find_nd_replace_focus_5548 branch September 9, 2024 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants