AppFlowy-IO / appflowy-editor

A highly customizable rich-text editor for Flutter. The AppFlowy Editor project for AppFlowy and beyond.
https://pub.dev/packages/appflowy_editor
Other
473 stars 201 forks source link

feat: Allow configuring the auto scroll edge offset #888

Closed snipd-min closed 2 months ago

snipd-min commented 2 months ago

When using the MobileFloatingToolbar with a markdown editor not in full screen design (e.g. if a docked footer is present on the screen), the default auto scroll edge might not work and would lead to the following assertion error:

  assert(
      globalRect.size.width >= _dragTargetRelatedToScrollOrigin.size.width &&
          globalRect.size.height >=
              _dragTargetRelatedToScrollOrigin.size.height,
      'Drag target size is larger than scrollable size, which may cause bouncing',
    );

In this case it might be useful to allow configuring the edge offset.

CLAassistant commented 2 months ago

CLA assistant check
All committers have signed the CLA.

LucasXu0 commented 2 months ago

@snipd-min Thanks for contribution. Please sign the CLA :)

snipd-min commented 2 months ago

Done :)

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 72.40%. Comparing base (5d1d311) to head (4d0ad39). Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...ditor_component/service/scroll_service_widget.dart 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #888 +/- ## ========================================== - Coverage 72.40% 72.40% -0.01% ========================================== Files 317 317 Lines 14785 14787 +2 ========================================== + Hits 10705 10706 +1 - Misses 4080 4081 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.