bdlukaa / bdlukaa/fluent_ui

🐛 [CommandBar] Tooltip not shown in secondary items

Open
#1,244 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Dart
Stars
3.5k
Forks
506
Avg merge
11d 2h
Merged PRs (30d)
3

Description

**Describe the bug**
The `CommandBar` let us add `CommandBarItems` as primary or secondary. The `CommandBarButton` has a `tooltip` field, but if the item is shown as secondary the tooltip will not be shown.

**To Reproduce**
An example:
```dart
PageHeader(
title: Text('Operations'),
commandBar: CommandBar(
mainAxisAlignment: MainAxisAlignment.end,
primaryItems: [
CommandBarButton(
onPressed: () {},
label: Text("Add an operation"),
icon: const Icon(FluentIcons.add_to_shopping_list),
tooltip: "Add a new operation", // This is shown on mouseover
),
],
secondaryItems: [
CommandBarButton(
onPressed: (){},
label: Text("Export operations"),
icon: const Icon(FluentIcons.export),
tooltip: 'export_all_your_operations_in_an_excel_file', // This is not shown
),
],
),
),
```

**Expected behavior**
The tooltip should be displayed in the secondary items menu too. A workaround for me actually is this:
```dart
CommandBarButton(
onPressed: (){},
label: Tooltip(
message:
'export_all_your_operations_in_an_excel_file',
child: Text("Export operations")),
icon: const Icon(FluentIcons.export),
),
```

**Additional context**
-

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the CommandBar and CommandBarButton implementations, comparing how tooltips are handled for primary items with how secondary items are rendered. Reproduce the provided example and verify that the secondary menu displays the button tooltip without requiring the workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.