microsoft / microsoft-ui-xaml

WinUI: a modern UI framework with a rich set of controls and styles to build dynamic and high-performing Windows applications.
MIT License
6.38k stars 683 forks source link

CommandBar is always displaying the "see more" button when text scaling is on #10117

Open vgromfeld opened 4 weeks ago

vgromfeld commented 4 weeks ago

Describe the bug

When text scaling is on, the CommandBar control is always displaying its "see more" button whereas there is no content in the overflow menu.

Steps to reproduce the bug

  1. Add the following XAML to an UWP application:

    <CommandBar
    VerticalContentAlignment="Center"
    DefaultLabelPosition="Right"
    OverflowButtonVisibility="Auto">
    <CommandBar.Content>
    <Button Content="Do something" Style="{StaticResource AccentButtonStyle}" />
    </CommandBar.Content>
    
    <AppBarButton Icon="Accept" Label="Action 1 with a long name" />
    <AppBarButton Icon="Remove" Label="Action 2 with a long name" />
    </CommandBar>
  2. From Windows' settings, set text scaling to 200%

  3. Run the application

  4. Ensure the app window is large enough to display all the buttons.

  5. The "see more" button is visible whereas there is nothing in the overflow menu CommandBar displaying its overflow button when text scaling is on

  6. Clicking on the button increases the command bar's height. CommandBar displaying its overflow button when text scaling is on

Expected behavior

The CommandBar control should keep the same behavior as when text scaling is disabled. The "see more" button should only be displayed when there are items in overflow or secondary commands.

The same command bar with text scaling off: CommandBar with text scaling off

Screenshots

No response

NuGet package version

WinUI 2 - Microsoft.UI.Xaml 2.8.2

Windows version

Windows 11 (22H2): Build 22621

Additional context

Could be related to #9299

github-actions[bot] commented 4 weeks ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.