microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.27k stars 674 forks source link

An improper shadow appears at the bottom of the CommandBarOverflowPresenter. #9834

Open Tamilarasan-Paranthaman opened 1 month ago

Tamilarasan-Paranthaman commented 1 month ago

Describe the bug

<StackPanel Orientation="Vertical">
    <CommandBar DefaultLabelPosition="Right">
        <CommandBar.Style>
            <Style TargetType="CommandBar">
                <Setter Property="Background"
                    Value="YellowGreen" />
            </Style>
        </CommandBar.Style>
        <AppBarToggleButton Icon="Edit" FontSize="30" Label="Edit"/>
        <AppBarToggleButton Icon="Share" Label="Share"/>
        <CommandBar.SecondaryCommands>
            <AppBarButton Icon="Like" Label="Like" Click="AppBarButton_Click"/>
            <AppBarButton Icon="Dislike" Label="Dislike" Click="AppBarButton_Click"/>
        </CommandBar.SecondaryCommands>
    </CommandBar>
    <Border>
        <TextBlock Text="Notes Page"/>
    </Border>
</StackPanel>

Steps to reproduce the bug

  1. Run the sample with above code snippet.
  2. Open the CommandBarOverflowPresenter.

Expected behavior

No response

Screenshots

image

NuGet package version

WinUI 3 - Windows App SDK 1.5.5: 1.5.240627000

Windows version

Windows 11 (22H2): Build 22621

Additional context

No response

kmgallahan commented 1 month ago

<Style TargetType="CommandBar"> replaces the entire CommandBar style with what you declare, which will cause problems like this.

<Style BasedOn="{StaticResource DefaultCommandBarStyle}" TargetType="CommandBar"> starts with the default and adds the changes you want to make.

ranjeshj commented 2 weeks ago

@Tamilarasan-Paranthaman does @kmgallahan's suggestion make this issue go away ?

michaelrinderle commented 1 week ago

We are having the same issue with .NET Maui for Windows by default when adding the toolbar to the TopBar, Issues: 18258 & 19166

I tried adding this to a vanilla Maui project in the it's Windows App.Xaml file with no luck. <Style BasedOn="{StaticResource DefaultCommandBarStyle}" TargetType="CommandBar">

Since it's coming up on a year soon without help or response from the MS Maui devs, do you guys have any insight on how to fix?

OliveInto commented 1 day ago

https://github.com/microsoft/microsoft-ui-xaml/blob/6b6cff9ac058bb290a664cd6cc1e6355d4be1aca/src/controls/dev/CommonStyles/CommandBar_themeresources.xaml#L883

From Maui user, I guess the problem is in this file. we need to set the height of "WindowedPopupPadding" not simply by binding, which adds unnecessary blank in the situation that there is already enough space.