diff --git a/super_text_layout/lib/src/text_selection_layer.dart b/super_text_layout/lib/src/text_selection_layer.dart index 1da37c14e1..be0c6a2009 100644 --- a/super_text_layout/lib/src/text_selection_layer.dart +++ b/super_text_layout/lib/src/text_selection_layer.dart @@ -22,12 +22,15 @@ class TextLayoutSelectionHighlight extends StatelessWidget { @override Widget build(BuildContext context) { - return CustomPaint( - painter: TextSelectionPainter( - textLayout: textLayout, - selectionColor: style.color, - borderRadius: style.borderRadius, - textSelection: selection, + return SizedBox( + width: double.infinity, + child: CustomPaint( + painter: TextSelectionPainter( + textLayout: textLayout, + selectionColor: style.color, + borderRadius: style.borderRadius, + textSelection: selection, + ), ), ); }