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

Scroll to selection after keyboard opened #285

Merged
merged 2 commits into from
Mar 27, 2024

Conversation

Amir-P
Copy link
Member

@Amir-P Amir-P commented Feb 23, 2024

Fixes #280.

@Amir-P Amir-P requested a review from amantoux February 23, 2024 17:45
Copy link

codecov bot commented Feb 23, 2024

Codecov Report

Attention: Patch coverage is 47.82609% with 12 lines in your changes are missing coverage. Please review.

Project coverage is 87.45%. Comparing base (be24068) to head (b149fb7).
Report is 6 commits behind head on master.

Files Patch % Lines
packages/fleather/lib/src/widgets/editor.dart 47.82% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #285      +/-   ##
==========================================
- Coverage   87.71%   87.45%   -0.27%     
==========================================
  Files          64       64              
  Lines       10416    11363     +947     
==========================================
+ Hits         9136     9937     +801     
- Misses       1280     1426     +146     

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

Copy link
Member

@amantoux amantoux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a question (+ a typo to fix)

packages/fleather/lib/src/widgets/editor.dart Outdated Show resolved Hide resolved
@@ -1474,6 +1474,7 @@ class RawEditorState extends EditorState
if (_hasFocus) {
// Listen for changing viewInsets, which indicates keyboard showing up.
WidgetsBinding.instance.addObserver(this);
_lastBottomViewInset = View.of(context).viewInsets.bottom;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this redundant with didChangeMetrics?

Copy link
Member Author

@Amir-P Amir-P Mar 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not receiving view inset changes while editor is unfocused. In order to have the latest bottom view inset we are fetching it when editor gained focus.

@Amir-P Amir-P requested a review from amantoux March 27, 2024 06:45
Copy link
Member

@amantoux amantoux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Thanks!

@amantoux amantoux merged commit 3b28f7f into master Mar 27, 2024
2 of 4 checks passed
@Amir-P Amir-P deleted the fix/scroll_to_selection_after_keyboard_opened branch March 27, 2024 08:09
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.

Cursor is covered by soft keyboard
2 participants