fix: unable to delete the callout block when it's in the first line (#7442)

This commit is contained in:
Lucas 2025-03-03 16:40:41 +08:00 committed by GitHub
parent fe6217bd82
commit 655de30df5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 23 additions and 3 deletions

View File

@ -700,7 +700,14 @@ TableBlockComponentBuilder _buildTableBlockComponentBuilder(
BlockComponentConfiguration configuration, BlockComponentConfiguration configuration,
) { ) {
return TableBlockComponentBuilder( return TableBlockComponentBuilder(
menuBuilder: (node, editorState, position, dir, onBuild, onClose) => menuBuilder: (
node,
editorState,
position,
dir,
onBuild,
onClose,
) =>
TableMenu( TableMenu(
node: node, node: node,
editorState: editorState, editorState: editorState,
@ -727,7 +734,14 @@ TableCellBlockComponentBuilder _buildTableCellBlockComponentBuilder(
} }
return buildEditorCustomizedColor(context, node, colorString); return buildEditorCustomizedColor(context, node, colorString);
}, },
menuBuilder: (node, editorState, position, dir, onBuild, onClose) => menuBuilder: (
node,
editorState,
position,
dir,
onBuild,
onClose,
) =>
TableMenu( TableMenu(
node: node, node: node,
editorState: editorState, editorState: editorState,

View File

@ -154,7 +154,10 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage>
]); ]);
indentableBlockTypes.add(ToggleListBlockKeys.type); indentableBlockTypes.add(ToggleListBlockKeys.type);
convertibleBlockTypes.add(ToggleListBlockKeys.type); convertibleBlockTypes.addAll([
ToggleListBlockKeys.type,
CalloutBlockKeys.type,
]);
effectiveScrollController = widget.scrollController ?? ScrollController(); effectiveScrollController = widget.scrollController ?? ScrollController();
// disable the color parse in the HTML decoder. // disable the color parse in the HTML decoder.

View File

@ -210,6 +210,9 @@ class _CalloutBlockComponentWidgetState
key: ValueKey(widget.node.id + emoji.emoji), key: ValueKey(widget.node.id + emoji.emoji),
enable: editorState.editable, enable: editorState.editable,
title: '', title: '',
margin: UniversalPlatform.isMobile
? const EdgeInsets.symmetric(vertical: 2.0, horizontal: 10.0)
: EdgeInsets.zero,
emoji: emoji, emoji: emoji,
emojiSize: emojiSize, emojiSize: emojiSize,
showBorder: false, showBorder: false,