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

Assertion fails for swipe typing + Undo (Android) #1884

Closed
1 task done
Alspb opened this issue May 20, 2024 · 0 comments · Fixed by #1898
Closed
1 task done

Assertion fails for swipe typing + Undo (Android) #1884

Alspb opened this issue May 20, 2024 · 0 comments · Fixed by #1898
Labels
bug Something isn't working

Comments

@Alspb
Copy link
Collaborator

Alspb commented May 20, 2024

Is there an existing issue for this?

Flutter Quill version

master

Steps to reproduce

  1. Open an empty editor window.
  2. Enter "Test text" using swipe typing.
  3. Press undo.

Expected results

No assertion failures.

Actual results

The following assertion fails:

TextPosition globalToLocalPosition(TextPosition position) {
    assert(container.containsOffset(position.offset),
        'The provided text position is not in the current node');
    return TextPosition(
      offset: position.offset - container.documentOffset,
      affinity: position.affinity,
    );
}

When adding print( 'position.offset=${position.offset}, container.containsOffset(position.offset)=${container.containsOffset(position.offset)}'); before assert it prints

position.offset=4, container.containsOffset(position.offset)=true

several times after Undo was pressed but then for some reason it prints

position.offset=5, container.containsOffset(position.offset)=false

and then the assert statement fails.

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Assert.swipe.typing.undo.webm

Logs

Logs
[Paste your logs here]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant