diff --git a/lib/src/widgets/others/text_selection.dart b/lib/src/widgets/others/text_selection.dart index 4a11cf5cd..cb9463a61 100644 --- a/lib/src/widgets/others/text_selection.dart +++ b/lib/src/widgets/others/text_selection.dart @@ -82,7 +82,10 @@ class EditorTextSelectionOverlay { // our listener being created // we won't know the status unless there is forced update // i.e. occasionally no paste - if (clipboardStatus != null) { + if (clipboardStatus != null && !kIsWeb) { + // Web - esp Safari Mac/iOS has security measures in place that restrict + // cliboard status checks w/o direct user interaction. So skip this + // for web clipboardStatus!.update(); } } diff --git a/lib/src/widgets/raw_editor/raw_editor_state.dart b/lib/src/widgets/raw_editor/raw_editor_state.dart index bc19f1b0e..1798722cb 100644 --- a/lib/src/widgets/raw_editor/raw_editor_state.dart +++ b/lib/src/widgets/raw_editor/raw_editor_state.dart @@ -4,7 +4,7 @@ import 'dart:math' as math; import 'dart:ui' as ui hide TextStyle; import 'package:collection/collection.dart'; -import 'package:flutter/foundation.dart' show defaultTargetPlatform; +import 'package:flutter/foundation.dart' show defaultTargetPlatform, kIsWeb; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart' show RenderAbstractViewport; import 'package:flutter/scheduler.dart' show SchedulerBinding; @@ -524,7 +524,13 @@ class QuillRawEditorState extends EditorState ); if (!widget.configurations.disableClipboard) { - _clipboardStatus = ClipboardStatusNotifier(); + // Web - esp Safari Mac/iOS has security measures in place that restrict + // cliboard status checks w/o direct user interaction. Initializing the + // ClipboardStatusNotifier with a default value of unknown will cause the + // clipboard status to be checked w/o user interaction which fails. Default + // to pasteable for web. + _clipboardStatus = ClipboardStatusNotifier( + value: kIsWeb ? ClipboardStatus.pasteable : ClipboardStatus.unknown); } if (widget.configurations.scrollable) {