Skip to content

Commit 3b72add

Browse files
fix: fixed regression in list marker positioning (#1468)
1 parent ed1f5e9 commit 3b72add

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

lib/src/css_box_widget.dart

+9-7
Original file line numberDiff line numberDiff line change
@@ -616,13 +616,15 @@ class RenderCSSBox extends RenderBox
616616
RenderBox? markerBox = childParentData.nextSibling;
617617
if (markerBox != null) {
618618
final markerBoxParentData = markerBox.parentData! as CSSBoxParentData;
619-
final distance = (child.getDistanceToBaseline(TextBaseline.alphabetic,
620-
onlyReal: true) ??
621-
0) +
622-
topOffset;
623-
final offsetHeight = distance -
624-
(markerBox.getDistanceToBaseline(TextBaseline.alphabetic) ??
625-
markerBox.size.height);
619+
// final distance = (child.getDistanceToBaseline(TextBaseline.alphabetic,
620+
// onlyReal: true) ??
621+
// 0) +
622+
// topOffset;
623+
// final offsetHeight = distance -
624+
// (markerBox.getDistanceToBaseline(TextBaseline.alphabetic) ??
625+
// markerBox.size.height);
626+
// TODO handle block children better by modifying above approach
627+
final offsetHeight = topOffset;
626628
switch (_textDirection) {
627629
case TextDirection.rtl:
628630
markerBoxParentData.offset = Offset(

lib/src/style.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ class Style {
297297

298298
TextStyle generateTextStyle() {
299299
return TextStyle(
300-
backgroundColor: backgroundColor,
300+
backgroundColor: (display?.isBlock ?? false) ? null : backgroundColor,
301301
color: color,
302302
decoration: textDecoration,
303303
decorationColor: textDecorationColor,

0 commit comments

Comments
 (0)