dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.23k stars 1.76k forks source link

Searchhandler dissapears or does not appear at all #20367

Open Legends opened 9 months ago

Legends commented 9 months ago

Description

Android only (Works on Windows)

When I add a <Shell.TitleView> with content to my AppShell.xaml the search handler of each page does not appear anymore. Except for the CatsPage.xaml page where the searchhandler is shown at application start, but the Shell.TitleView is not shown. When i switch through the tabs in the tabbar you can see, that none of the pages show the searchhandler anymore, but all of them show the Shell.TitleView . Now when I switch back to the CatsPage.xaml, the searchhandler is gone here too and the Shell.TitleView is visible now.

The gif starts with the CatsPage and a visible search box: Screenrecorder-2024-02-05-19-32-53-277-ezgif com-optimize

When I remove <Shell.TitleView> it works again, each page shows its seachhandler.

Expected: The search handler to be visible on every page Dogs,Cats,Monkeys,Bears,Elephants. Each of them has a searchhandler.

Steps to Reproduce

  1. Add following xaml to AppShell.xaml:

    <Shell.TitleView>
        <HorizontalStackLayout HorizontalOptions="CenterAndExpand"
                               VerticalOptions="CenterAndExpand">
            <Label Text="I am Shell.TitleView"
                   TextColor="Green"
                   HorizontalOptions="Center"
                   VerticalOptions="Center"
                   Padding="0,10,10,0" />
            <Image Source="info.png"
                   WidthRequest="20"
                   Margin="0,0,0,-10"
                   HorizontalOptions="Center"
                   VerticalOptions="Center" />
        </HorizontalStackLayout>
    </Shell.TitleView>
  2. Platform: Choose your local android device

  3. F5

Link to public reproduction project repository

https://github.com/dotnet/maui-samples/tree/main/8.0/Fundamentals/Shell

Version with bug

8.0.3

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 11 - API 30

Did you find any workaround?

no

Relevant log output

No response

ghost commented 9 months ago

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

XamlTest commented 8 months ago

Verified this on VS 17.10.0 Preview 2.0(8.0.7). Repro on Android 14.0-API34, not repro on Windows 11, iOS 17.2 and MacCatalyst with below Project: Xaminals.zip