Skip to content

Fix crash when inserting newlines rapidly#578

Open
bilaldev05 wants to merge 1 commit intofleather-editor:masterfrom
bilaldev05:master
Open

Fix crash when inserting newlines rapidly#578
bilaldev05 wants to merge 1 commit intofleather-editor:masterfrom
bilaldev05:master

Conversation

@bilaldev05
Copy link

This PR fixes an assertion failure in editable_box.dart when rapidly inserting new lines.

Under fast input, the document model can grow faster than the render tree updates, causing childAtPosition() to return null.

Instead of asserting, we now gracefully fallback to the last available child.

Steps to reproduce:

  1. Open demo app
  2. Hold Enter to insert many new lines
  3. Observe assertion error in console

After fix:
No assertion occurs and scrolling works normally.

Tested on:
Android (Pixel Fold)
Flutter 3.41.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant