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

[BUG] - Crash occurs when trying to long press (scroll) on a non-text node on Android/iOS. #2126

Open
rafalplonka opened this issue Jun 24, 2024 · 0 comments
Assignees
Labels
area_supereditor Pertains to SuperEditor bounty_junior f:superlist Funded by Superlist time:2 type_bug Something isn't working

Comments

@rafalplonka
Copy link

Package Version
super_editor, GitHub, stable branch

User Info
Knips (https://knips.io) - We are working on replacing our Block Text Editor with the Super Editor (not released yet). The editor will be used to create posts on our platform.

To Reproduce

  1. Build the demo app on Android/iOS.
  2. Add a non-text node, such as an image or divider.
  3. Long press on the node (this could happen when a user is trying to scroll).
  4. The app crashes.

Minimal Reproduction Code
The bug is present in the demo app.

Actual behavior
Crash

The following _TypeError was thrown while handling a gesture:
Null check operator used on a null value

When the exception was thrown, this was the stack: 
#0      AndroidDocumentLongPressSelectionStrategy.onLongPressDragUpdate (package:super_editor/src/infrastructure/platforms/android/long_press_selection.dart:221:74)
#1      _AndroidDocumentTouchInteractorState._onLongPressPanUpdate (package:super_editor/src/default_editor/document_gestures_touch_android.dart:1072:25)
#2      _AndroidDocumentTouchInteractorState._onPanUpdate (package:super_editor/src/default_editor/document_gestures_touch_android.dart:1050:7)
#3      DragGestureRecognizer._checkUpdate.<anonymous closure> (package:flutter/src/gestures/monodrag.dart:806:55)
#4      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:344:24)
#5      DragGestureRecognizer._checkUpdate (package:flutter/src/gestures/monodrag.dart:806:7)
#6      DragGestureRecognizer.handleEvent (package:flutter/src/gestures/monodrag.dart:652:11)
#7      PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:98:12)
#8      PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:143:9)
#9      _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:633:13)
#10     PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:141:18)
#11     PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:127:7)
#12     GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:495:19)
#13     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:475:22)
#14     RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:425:11)
#15     GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:420:7)
#16     GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:383:5)
#17     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:330:7)
#18     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:299:9)
#19     _invoke1 (dart:ui/hooks.dart:328:13)
#20     PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:442:7)
#21     _dispatchPointerDataPacket (dart:ui/hooks.dart:262:31)
Handler: "onUpdate"
Recognizer: VerticalDragGestureRecognizer#7209a
  start behavior: down

Expected behavior
No crash, user is able to scroll/long-press without any issue

Platform
Android/iOS

Flutter version
3.22.2

@rafalplonka rafalplonka added the type_bug Something isn't working label Jun 24, 2024
@matthew-carroll matthew-carroll added area_supereditor Pertains to SuperEditor bounty_junior f:superlist Funded by Superlist time:2 labels Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area_supereditor Pertains to SuperEditor bounty_junior f:superlist Funded by Superlist time:2 type_bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants