Skip to content

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.

fix: unable to see the text of link menu in dark mode (#4239)

Lucas.Xuf5bfcdcb9832
diff --git a/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/bottom_sheet_edit_link_widget.dart b/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/bottom_sheet_edit_link_widget.dart
index 4d6eee65d5..871811c2bf 100644
--- a/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/bottom_sheet_edit_link_widget.dart
+++ b/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/bottom_sheet_edit_link_widget.dart
@@ -79,8 +79,7 @@ class _MobileBottomSheetEditLinkWidgetState
TextEditingController controller,
String? hintText,
) {
- return Container(
- color: Colors.white,
+ return SizedBox(
height: 48.0,
child: FlowyTextField(
controller: controller,
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_item/utils.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_item/utils.dart
index 1fe4fe1796..699bce2f73 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_item/utils.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_item/utils.dart
@@ -2,13 +2,13 @@ import 'package:appflowy/mobile/presentation/bottom_sheet/bottom_sheet.dart';
import 'package:appflowy/mobile/presentation/bottom_sheet/bottom_sheet_edit_link_widget.dart';
import 'package:flutter/material.dart';
-void showEditLinkBottomSheet(
+Future<T?> showEditLinkBottomSheet<T>(
BuildContext context,
String text,
String? href,
void Function(BuildContext context, String text, String href) onEdit,
) {
- showMobileBottomSheet(
+ return showMobileBottomSheet(
context,
showHeader: false,
builder: (context) {
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/_block_items.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/_block_items.dart
index 9c54c9b6fa..ddebcae99e 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/_block_items.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/_block_items.dart
@@ -128,7 +128,7 @@ class BlockItems extends StatelessWidget {
);
}
- void _onLinkItemTap() {
+ void _onLinkItemTap() async {
final selection = editorState.selection;
if (selection == null) {
return;
@@ -139,6 +139,17 @@ class BlockItems extends StatelessWidget {
if (context != null) {
_closeKeyboard(selection);
+ // keep the selection
+ editorState.updateSelectionWithReason(
+ selection,
+ extraInfo: {
+ selectionExtraInfoDisableMobileToolbarKey: true,
+ selectionExtraInfoDoNotAttachTextService: true,
+ selectionExtraInfoDisableFloatingToolbar: true,
+ },
+ );
+ keepEditorFocusNotifier.increase();
+
final text = editorState
.getTextInSelection(
selection,
@@ -148,7 +159,7 @@ class BlockItems extends StatelessWidget {
AppFlowyRichTextKeys.href,
selection,
);
- showEditLinkBottomSheet(
+ await showEditLinkBottomSheet(
context,
text,
href,
@@ -160,9 +171,14 @@ class BlockItems extends StatelessWidget {
newHref,
selection: selection,
);
- context.pop();
+ context.pop(true);
},
);
+ // re-open the keyboard again
+ editorState.updateSelectionWithReason(
+ selection,
+ extraInfo: {},
+ );
}
}
diff --git a/frontend/appflowy_flutter/pubspec.lock b/frontend/appflowy_flutter/pubspec.lock
index 18c44cfcb8..25df895f1d 100644
--- a/frontend/appflowy_flutter/pubspec.lock
+++ b/frontend/appflowy_flutter/pubspec.lock
@@ -44,8 +44,8 @@ packages:
dependency: "direct main"
description:
path: "."
- ref: "93a1b70"
- resolved-ref: "93a1b70858801583b5a7edb0b2c06308d7982054"
+ ref: "15a3a50"
+ resolved-ref: "15a3a5071ffdb002ffaefda9df343b6800844d8d"
url: "https://github.com/AppFlowy-IO/appflowy-board.git"
source: git
version: "0.1.1"