From 37dad206f14ba409508b034f8bdde161954a0ca1 Mon Sep 17 00:00:00 2001 From: Mike Allen Date: Sat, 11 Feb 2023 12:30:38 -0800 Subject: [PATCH] update clipboard status prior to showing selected text overlay --- lib/src/widgets/text_selection.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/src/widgets/text_selection.dart b/lib/src/widgets/text_selection.dart index dd6d6c18..74bcf55f 100644 --- a/lib/src/widgets/text_selection.dart +++ b/lib/src/widgets/text_selection.dart @@ -83,6 +83,11 @@ class EditorTextSelectionOverlay { }) { final overlay = Overlay.of(context, rootOverlay: true); + // Clipboard status is only checked on first instance of ClipboardStatusNotifier + // if state has changed after creation, but prior to our listener being created + // we won't know the status unless there is forced update i.e. occasionally no paste + this.clipboardStatus.update(); + _toolbarController = AnimationController( duration: const Duration(milliseconds: 150), vsync: overlay); }