Skip to content

Commit

Permalink
fix: nested block padding issues
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasXu0 committed Jan 15, 2025
1 parent 05c1924 commit ec01c96
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,16 @@ BlockComponentConfiguration _buildDefaultConfiguration(BuildContext context) {

return const EdgeInsets.symmetric(vertical: 5.0);
},
indentPadding: (node, textDirection) => textDirection == TextDirection.ltr
? const EdgeInsets.only(left: 26.0)
: const EdgeInsets.only(right: 26.0),
indentPadding: (node, textDirection) {
double padding = 26.0;
// only add indent padding for the top level node to align the children
if (UniversalPlatform.isMobile && node.path.length == 1) {
padding += EditorStyleCustomizer.nodeHorizontalPadding;
}
return textDirection == TextDirection.ltr
? EdgeInsets.only(left: padding)
: EdgeInsets.only(right: padding);
},
);
return configuration;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,9 @@ class _ToggleListBlockComponentWidgetState
}

return Padding(
padding: indentPadding,
padding: UniversalPlatform.isMobile
? const EdgeInsets.symmetric(horizontal: 26.0)
: indentPadding,
child: FlowyButton(
text: FlowyText(
buildPlaceholderText(),
Expand Down

0 comments on commit ec01c96

Please sign in to comment.