[GH-ISSUE #1586] [Bug] Editor: deleting an image causes the editor to enter a bad state #612

Closed
opened 2026-03-23 20:38:41 +00:00 by mirror · 0 comments
Owner

Originally created by @floryst on GitHub (Dec 19, 2022).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/1586

Originally assigned to: @LucasXu0 on GitHub.

Bug Description

Deleting an image via selection (instead of the trash button) prevents further typing until you hit "Enter" or click on the line. This occurs in both the AppFlowy app and the AppFlowy Editor example component.

How to Reproduce

  1. Type /image to create an image.
  2. Enter in an invalid image URL, e.g. "invalid"
  3. Click on the image element, which should say "Could not load image". A blue selection box should appear around the component.
  4. Hit Backspace to delete the image element.
  5. Try typing. At most a single character will appear, and no further characters will show up.

Expected Behavior

Deleting an (invalid) image does not result in a bad internal editor state.

Operating System

macOS 12

AppFlowy Version(s)

0.0.8.1.1

Screenshots

No response

Additional Context

Below is the exception I receive when running the AppFlowy Editor example.

The following StateError was thrown during method call TextInputClient.updateEditingStateWithDeltas:
Bad state: No element

call:
  MethodCall(TextInputClient.updateEditingStateWithDeltas, [12, {deltas: [{oldText:
  , deltaText: s, deltaStart: 1, deltaEnd: 1, selectionBase: 2, selectionExtent: 2, composingBase:
  null, composingExtent: null}]}])
Originally created by @floryst on GitHub (Dec 19, 2022). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/1586 Originally assigned to: @LucasXu0 on GitHub. ### Bug Description Deleting an image via selection (instead of the trash button) prevents further typing until you hit "Enter" or click on the line. This occurs in both the AppFlowy app and the AppFlowy Editor example component. ### How to Reproduce 1. Type `/image` to create an image. 2. Enter in an invalid image URL, e.g. "invalid" 3. Click on the image element, which should say "Could not load image". A blue selection box should appear around the component. 4. Hit Backspace to delete the image element. 5. Try typing. At most a single character will appear, and no further characters will show up. ### Expected Behavior Deleting an (invalid) image does not result in a bad internal editor state. ### Operating System macOS 12 ### AppFlowy Version(s) 0.0.8.1.1 ### Screenshots _No response_ ### Additional Context Below is the exception I receive when running the AppFlowy Editor example. ``` The following StateError was thrown during method call TextInputClient.updateEditingStateWithDeltas: Bad state: No element call: MethodCall(TextInputClient.updateEditingStateWithDeltas, [12, {deltas: [{oldText: , deltaText: s, deltaStart: 1, deltaEnd: 1, selectionBase: 2, selectionExtent: 2, composingBase: null, composingExtent: null}]}]) ```
mirror 2026-03-23 20:38:41 +00:00
  • closed this issue
  • added the
    editor
    bug
    labels
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#612
No description provided.