Skip to content

Commit

Permalink
fix: [DX-2051] Fix OptimusTab title overflow (#666)
Browse files Browse the repository at this point in the history
  • Loading branch information
witwash authored Sep 5, 2024
1 parent 26e5541 commit a249be3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions optimus/lib/src/tabs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class OptimusTab extends StatelessWidget {

return Container(
padding: EdgeInsets.symmetric(horizontal: tokens.spacing150),
height: 48,
height: tokens.sizing600,
constraints: BoxConstraints(maxWidth: maxWidth ?? double.infinity),
child: Row(
mainAxisSize: MainAxisSize.min,
Expand All @@ -46,7 +46,7 @@ class OptimusTab extends StatelessWidget {
padding: EdgeInsets.only(right: tokens.spacing50),
child: Icon(icon, size: tokens.sizing200),
),
Text(label, overflow: TextOverflow.ellipsis),
Flexible(child: Text(label, overflow: TextOverflow.ellipsis)),
if (badge case final badge?)
Padding(
padding: EdgeInsets.only(left: tokens.spacing50),
Expand Down
2 changes: 1 addition & 1 deletion storybook/lib/stories/tab/tabs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final Story tabsStory = Story(
tabs: _items
.map(
(i) => OptimusTab(
label: 'Tab ${i + 1}',
label: i.isEven ? 'Tab with long name' : 'Tab ${i + 1}',
icon: i.isOdd ? icon : null,
badge: i.isOdd ? badge : null,
maxWidth: _tabBarWidth / _items.length,
Expand Down

0 comments on commit a249be3

Please sign in to comment.