Skip to content

Commit 6bc1a30

Browse files
committed
fix: nested block padding issues
1 parent a247487 commit 6bc1a30

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,16 @@ BlockComponentConfiguration _buildDefaultConfiguration(BuildContext context) {
102102

103103
return const EdgeInsets.symmetric(vertical: 5.0);
104104
},
105-
indentPadding: (node, textDirection) => textDirection == TextDirection.ltr
106-
? const EdgeInsets.only(left: 26.0)
107-
: const EdgeInsets.only(right: 26.0),
105+
indentPadding: (node, textDirection) {
106+
double padding = 26.0;
107+
// only add indent padding for the top level node to align the children
108+
if (UniversalPlatform.isMobile && node.path.length == 1) {
109+
padding += EditorStyleCustomizer.nodeHorizontalPadding;
110+
}
111+
return textDirection == TextDirection.ltr
112+
? EdgeInsets.only(left: padding)
113+
: EdgeInsets.only(right: padding);
114+
},
108115
);
109116
return configuration;
110117
}

frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/toggle/toggle_block_component.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,9 @@ class _ToggleListBlockComponentWidgetState
287287
}
288288

289289
return Padding(
290-
padding: indentPadding,
290+
padding: UniversalPlatform.isMobile
291+
? const EdgeInsets.symmetric(horizontal: 26.0)
292+
: indentPadding,
291293
child: FlowyButton(
292294
text: FlowyText(
293295
buildPlaceholderText(),

0 commit comments

Comments
 (0)