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

This commit is contained in:
Lucas.Xu 2023-12-29 11:18:00 +08:00 committed by GitHub
parent d57b61b213
commit f5bfcdcb98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 9 deletions

View File

@ -79,8 +79,7 @@ class _MobileBottomSheetEditLinkWidgetState
TextEditingController controller,
String? hintText,
) {
return Container(
color: Colors.white,
return SizedBox(
height: 48.0,
child: FlowyTextField(
controller: controller,

View File

@ -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) {

View File

@ -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: {},
);
}
}

View File

@ -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"