singerdmx / flutter-quill

Rich text editor for Flutter
https://pub.dev/packages/flutter_quill
MIT License
2.6k stars 840 forks source link

Refine IME composing range styling by applying underline as text style #2244

Closed agata closed 2 months ago

agata commented 2 months ago

Description

Changed the implementation of the underline styling during IME conversion. Instead of manually drawing a line beneath the composing text, the underline is now applied directly as a text style to the conversion range. This simplifies the implementation and brings it in line with Flutter's standard TextEditingController behavior.

TextEditingController#buildTextSpan https://github.com/flutter/flutter/blob/2277e055508ee6e11ea1313a06ec5b353e76eecc/packages/flutter/lib/src/widgets/editable_text.dart#L285-L309

In the previous implementation, there was an issue where the composing style appeared like a strikethrough, positioned around the middle of the text, especially when the text height was higher than usual, such as with headers. This issue has been completely resolved with the current fix.

before: before

after: after

Related Issues

Suggestions