Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
fix: pasting a link on iOS results in incorrect behavior (#7326)
Morn17ae05a62337
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_page.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_page.dartindex d83bd055ce..5c3762b438 100644--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_page.dart+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_page.dart@@ -111,6 +111,7 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage>}EditorStyleCustomizer get styleCustomizer => widget.styleCustomizer;+DocumentBloc get documentBloc => context.read<DocumentBloc>();late final EditorScrollController editorScrollController;diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/clipboard_service.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/clipboard_service.dartindex f4aac4fe2c..f108c7e26b 100644--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/clipboard_service.dart+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/clipboard_service.dart@@ -132,6 +132,7 @@ class ClipboardService {final html = await reader.readValue(Formats.htmlText);final inAppJson = await reader.readValue(inAppJsonFormat);final tableJson = await reader.readValue(tableJsonFormat);+ final uri = await reader.readValue(Formats.uri);(String, Uint8List?)? image;if (reader.canProvide(Formats.png)) {image = ('png', await reader.readFile(Formats.png));@@ -144,7 +145,7 @@ class ClipboardService {}return ClipboardServiceData(- plainText: plainText,+ plainText: plainText ?? uri?.uri.toString(),html: html,image: image,inAppJson: inAppJson,diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/custom_paste_command.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/custom_paste_command.dartindex c523453fba..5c25d470d5 100644--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/custom_paste_command.dart+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/custom_paste_command.dart@@ -144,6 +144,13 @@ Future<void> doPaste(EditorState editorState) async {}if (plainText != null && plainText.isNotEmpty) {+ final currentSelection = editorState.selection;+ if (currentSelection == null) {+ await editorState.updateSelectionWithReason(+ selection,+ reason: SelectionUpdateReason.uiEvent,+ );+ }await editorState.pasteText(plainText);return Log.info('Pasted plain text');}