flutter-quill
flutter-quill copied to clipboard
Assertion fails for swipe typing + Undo (Android)
Is there an existing issue for this?
- [X] I have searched the existing issues
Flutter Quill version
master
Steps to reproduce
- Open an empty editor window.
- Enter "Test text" using swipe typing.
- 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
Logs
Logs
[Paste your logs here]