AppFlowy-IO / AppFlowy-IO/appflowy-editor

[Bug] After selecting all and pressing delete on the keyboard, the editor can no longer function.

Open
#1,001 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Dart
Stars
684
Forks
329
PR merge metrics
No merged PRs in 30d

Description

### Bug Description

When double-tap the text, select "Select All" from the toolbar that appears, and then click "Delete,", the editor can no longer function. The official demo can reproduce this problem.

```
Flutter Error Caught: Invalid argument(s): 0
StackTrace: #0 int.clamp (dart:core-patch/integers.dart:280:7)
#1 EditorStateSelection._findCloseNode (package:appflowy_editor/src/editor/editor_component/service/selection/shared.dart:98:16)
#2 EditorStateSelection.getNodeInOffset (package:appflowy_editor/src/editor/editor_component/service/selection/shared.dart:41:15)
#3 _MobileSelectionServiceWidgetState.getNodeInOffset (package:appflowy_editor/src/editor/editor_component/service/selection/mobile_selection_service.dart:364:24)
#4 _MobileSelectionServiceWidgetState._onTapUpIOS (package:appflowy_editor/src/editor/editor_component/service/selection/mobile_selection_service.dart:585:20)
#5 MobileSelectionGestureDetectorState._tapDownDelegate (package:appflowy_editor/src/service/selection/mobile_selection_gesture.dart:119:24)
#6 TapGestureRecognizer.handleTapUp. (package:flutter/src/gestures/tap.dart:653:57)
#7 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:351:24)
```

### How to Reproduce

When running the demo project on iOS, if you double-tap the text, select "Select All" from the toolbar that appears, and then click "Delete," the following error will be reported. The official demo can reproduce this problem.

### Expected Behavior

We hope to delete the content normally without errors, ensuring the editor functions properly.

### Operating System

iOS

### AppFlowy Editor Version(s)

4.0.0

### Screenshots

_No response_

### Additional Context

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.