superlistapp / super_editor

A Flutter toolkit for building document editors and readers
https://superlist.com/SuperEditor/
MIT License
1.64k stars 239 forks source link

[BUG] - Exception when pressing space after cancelling action tag #2177

Closed KevinBrendel closed 3 weeks ago

KevinBrendel commented 1 month ago

Package Version super_editor, GitHub, stable branch

User Info coneno, QuikFlow

To Reproduce Steps to reproduce the behavior:

  1. Go to the action tags demo in the example app
  2. Write an action tag which does not match any of the options (so that "NO ACTIONS" is displayed)
  3. Cancel using escape
  4. Press space

Actual behavior An exception is thrown.

Screenshot 2024-07-19 at 20 43 53

Expected behavior A space is inserted and no exception is thrown.

Platform macOS

Flutter version Flutter 3.22.3 • channel stable • https://github.com/flutter/flutter.git Framework • revision b0850beeb2 (3 days ago) • 2024-07-16 21:43:41 -0700 Engine • revision 235db911ba Tools • Dart 3.4.4 • DevTools 2.34.3

KevinBrendel commented 1 month ago

This can also happen when the matched tag list was not empty when cancelling.

KevinBrendel commented 1 month ago

I have noticed that when this occurs, an actionTagCancelledAttribution is added to the end of the composed tag. This attribution is not added there when cancelling the action tag by just continuing to type using space, in which case the exception is also not triggered.

image
matthew-carroll commented 1 month ago

@KevinBrendel can you confirm that this PR solves your problem: https://github.com/superlistapp/super_editor/pull/2191

KevinBrendel commented 1 month ago

Yes, I can confirm that it solves the issue, thanks.