From 80cd5455e14efaaf82287503f878cc8e673f6de1 Mon Sep 17 00:00:00 2001 From: Mike Allen Date: Mon, 29 Jan 2024 13:48:44 -0800 Subject: [PATCH] Pasted text should not use toggled style. --- lib/src/widgets/quill/quill_controller.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/src/widgets/quill/quill_controller.dart b/lib/src/widgets/quill/quill_controller.dart index 6458bc0a..7f95a6cf 100644 --- a/lib/src/widgets/quill/quill_controller.dart +++ b/lib/src/widgets/quill/quill_controller.dart @@ -303,7 +303,9 @@ class QuillController extends ChangeNotifier { var shouldRetainDelta = toggledStyle.isNotEmpty && delta.isNotEmpty && delta.length <= 2 && - delta.last.isInsert; + delta.last.isInsert && + // pasted text should not use toggledStyle + (data is! String || data.length < 2); if (shouldRetainDelta && toggledStyle.isNotEmpty && delta.length == 2 &&