Skip to content

Commit f5bfcdc

Browse files
authored
fix: unable to see the text of link menu in dark mode (#4239)
1 parent d57b61b commit f5bfcdc

File tree

4 files changed

+24
-9
lines changed

4 files changed

+24
-9
lines changed

frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/bottom_sheet_edit_link_widget.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ class _MobileBottomSheetEditLinkWidgetState
7979
TextEditingController controller,
8080
String? hintText,
8181
) {
82-
return Container(
83-
color: Colors.white,
82+
return SizedBox(
8483
height: 48.0,
8584
child: FlowyTextField(
8685
controller: controller,

frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_item/utils.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import 'package:appflowy/mobile/presentation/bottom_sheet/bottom_sheet.dart';
22
import 'package:appflowy/mobile/presentation/bottom_sheet/bottom_sheet_edit_link_widget.dart';
33
import 'package:flutter/material.dart';
44

5-
void showEditLinkBottomSheet(
5+
Future<T?> showEditLinkBottomSheet<T>(
66
BuildContext context,
77
String text,
88
String? href,
99
void Function(BuildContext context, String text, String href) onEdit,
1010
) {
11-
showMobileBottomSheet(
11+
return showMobileBottomSheet(
1212
context,
1313
showHeader: false,
1414
builder: (context) {

frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/_block_items.dart

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class BlockItems extends StatelessWidget {
128128
);
129129
}
130130

131-
void _onLinkItemTap() {
131+
void _onLinkItemTap() async {
132132
final selection = editorState.selection;
133133
if (selection == null) {
134134
return;
@@ -139,6 +139,17 @@ class BlockItems extends StatelessWidget {
139139
if (context != null) {
140140
_closeKeyboard(selection);
141141

142+
// keep the selection
143+
editorState.updateSelectionWithReason(
144+
selection,
145+
extraInfo: {
146+
selectionExtraInfoDisableMobileToolbarKey: true,
147+
selectionExtraInfoDoNotAttachTextService: true,
148+
selectionExtraInfoDisableFloatingToolbar: true,
149+
},
150+
);
151+
keepEditorFocusNotifier.increase();
152+
142153
final text = editorState
143154
.getTextInSelection(
144155
selection,
@@ -148,7 +159,7 @@ class BlockItems extends StatelessWidget {
148159
AppFlowyRichTextKeys.href,
149160
selection,
150161
);
151-
showEditLinkBottomSheet(
162+
await showEditLinkBottomSheet(
152163
context,
153164
text,
154165
href,
@@ -160,9 +171,14 @@ class BlockItems extends StatelessWidget {
160171
newHref,
161172
selection: selection,
162173
);
163-
context.pop();
174+
context.pop(true);
164175
},
165176
);
177+
// re-open the keyboard again
178+
editorState.updateSelectionWithReason(
179+
selection,
180+
extraInfo: {},
181+
);
166182
}
167183
}
168184

frontend/appflowy_flutter/pubspec.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ packages:
4444
dependency: "direct main"
4545
description:
4646
path: "."
47-
ref: "93a1b70"
48-
resolved-ref: "93a1b70858801583b5a7edb0b2c06308d7982054"
47+
ref: "15a3a50"
48+
resolved-ref: "15a3a5071ffdb002ffaefda9df343b6800844d8d"
4949
url: "https://github.com/AppFlowy-IO/appflowy-board.git"
5050
source: git
5151
version: "0.1.1"

0 commit comments

Comments
 (0)