tneotia / html-editor-enhanced

A Flutter package that provides a WYSIWYG editor backed by flutter_inappwebview and the Summernote library.
https://pub.dev/packages/html_editor_enhanced
MIT License
275 stars 336 forks source link

[BUG] Editor content is not scrollable in Flutter 3.7.0 #365

Open manueltag opened 1 year ago

manueltag commented 1 year ago

Describe the bug Editor content is not scrollable in Flutter version 3.7.0. It seems to be a problem with the gesture recognizers set in the InAppWebView widget.

To Reproduce Steps to reproduce the behavior:

  1. Install the latest stable release of Flutter (3.7.0)
  2. Run the html-editor-enhanced library sample project.
  3. Try scrolling the contents of the editor.

Expected behavior The editor content should scroll when I do a vertical drag.

Screenshots https://user-images.githubusercontent.com/18601109/208055790-3a159760-ca4c-4c78-aaf9-a6a3c608e464.mp4

Device: Flutter 3.7.0, Android API 32.

Additional context I tried changing the gesture recognizers from:

gestureRecognizers: {
  Factory<VerticalDragGestureRecognizer>(
    () => VerticalDragGestureRecognizer()
  ),
  Factory<LongPressGestureRecognizer>(
    () => LongPressGestureRecognizer(duration: widgets.htmlEditorOptions.mobileLongPressDuration)
  ),
}

to:

gestureRecognizers: [
  Factory<OneSequenceGestureRecognizer>(
    () => new EagerGestureRecognizer()
  ),
].toSet()

and the content scrolls correctly.

manueltag commented 1 year ago

I fixed it by setting the mobileLongPressDuration parameter with a Duration equal to zero:

HtmlEditorOptions(
   mobileLongPressDuration: Duration.zero
)