Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grouped tab - search handler issue #20217

Open
Legends opened this issue Jan 29, 2024 · 2 comments
Open

Grouped tab - search handler issue #20217

Legends opened this issue Jan 29, 2024 · 2 comments
Labels
area-controls-shell Shell Navigation, Routes, Tabs, Flyout platform/android 🤖 platform/windows 🪟 t/bug Something isn't working
Milestone

Comments

@Legends
Copy link

Legends commented Jan 29, 2024

Description

The following code is from the .net maui samples repo.
Issue: dotnet/maui-samples#424
Link to sample "Xaminals" is attached.

The app uses Shell navigation.
Every page in this example has its own search handler configuration.

The issue occurs only for the grouped tab "Domestic" that has two tabs "Dogs" and "Cats".

Issue: The first page to load is "Cats", now when I switch to tab "Dogs" and search for dogs, I get cats!

When I put a breakpoint inside the OnQueryChanged method, I can see that the search handler is actually the
cats' search handler from the previous tab "Cats".

 <FlyoutItem Route="animals"
             FlyoutDisplayOptions="AsMultipleItems">
     <Tab Title="Domestic"
          Route="domestic"
          Icon="paw.png">

         <ShellContent Route="cats"
                       Style="{StaticResource DomesticShell}"
                       Title="Cats"
                       Icon="cat.png"
                       ContentTemplate="{DataTemplate views:CatsPage}" />

         <ShellContent Route="dogs"
                       x:Name="dogsItem"
                       Style="{StaticResource DomesticShell}"
                       Title="Dogs"
                       Icon="dog.png"
                       ContentTemplate="{DataTemplate views:DogsPage}" />
     </Tab>

Steps to Reproduce

1.) Run the app => VS F5
2.) Switch to Dogs page.
3.) Search for "Ben"
4.) Search result shows cats instead of dogs.

It can also happen that you go to another animal catergory and go back to dogs and it suddenly it works.
Or you come back to cats and and your search shows dogs.

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, Windows, I was not able test on other platforms

Affected platform versions

No response

Did you find any workaround?

no

Relevant log output

No response

@Legends Legends added the t/bug Something isn't working label Jan 29, 2024
@vitorelli
Copy link

Hello @Legends
I faced issues with SearchHandler, hence I changed to use Shell.TitleView which gave me more control over SearchBar. Please check if it works for you.
https://learn.microsoft.com/en-us/dotnet/api/microsoft.maui.controls.shell.titleviewproperty?view=net-maui-8.0#microsoft-maui-controls-shell-titleviewproperty

@PureWeen PureWeen added the area-controls-shell Shell Navigation, Routes, Tabs, Flyout label Jan 30, 2024
@PureWeen PureWeen added this to the Backlog milestone Jan 30, 2024
@ghost
Copy link

ghost commented Jan 30, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-shell Shell Navigation, Routes, Tabs, Flyout platform/android 🤖 platform/windows 🪟 t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants