From b7b1afc9e61a4d010cd067258b237a500830c59e Mon Sep 17 00:00:00 2001 From: Benjamin Quinn Date: Mon, 10 Oct 2022 14:29:17 -0400 Subject: [PATCH] Fixes null pointer when setting documents. (#974) --- lib/src/widgets/controller.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/src/widgets/controller.dart b/lib/src/widgets/controller.dart index e6b32180..00c4f37f 100644 --- a/lib/src/widgets/controller.dart +++ b/lib/src/widgets/controller.dart @@ -40,6 +40,10 @@ class QuillController extends ChangeNotifier { Document get document => _document; set document(doc) { _document = doc; + + // Prevent the selection from + _selection = const TextSelection(baseOffset: 0, extentOffset: 0); + notifyListeners(); }