Skip to content

🐛 [CommandBar] Tooltip not shown in secondary items #1244

@Asmitta-01

Description

@Asmitta-01

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:

         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:

                  CommandBarButton(
                    onPressed: (){},
                    label: Tooltip(
                        message:
                            'export_all_your_operations_in_an_excel_file',
                        child: Text("Export operations")),
                    icon: const Icon(FluentIcons.export),
                  ),

Additional context

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions