Skip to content

[Shell][Android] The truth is out there...but not on top tab search handlers #8716

@davidbritch

Description

@davidbritch

Description

I have this tab structure in my Shell app:

    <TabBar>
       <Tab Title="Domestic"
            Icon="paw.png">
           <ShellContent Title="Cats"
                         ContentTemplate="{DataTemplate views:CatsPage}" />
           <ShellContent Title="Dogs"
                         ContentTemplate="{DataTemplate views:DogsPage}" />
       </Tab>
      ...
    </TabBar>

So this gives us a Domestic bottom tab, and Cats and Dogs top tabs (within the Domestic tab).

CatsPage has a search handler which searches the cats data:

    <Shell.SearchHandler>
        <controls:AnimalSearchHandler Placeholder="Enter search term"
                                      ShowsResults="true"
                                      ItemTemplate="{StaticResource AnimalSearchTemplate}"
                                      Animals="{x:Static data:CatData.Cats}"
                                      SelectedItemNavigationTarget="{x:Type views:CatDetailPage}" />
   </Shell.SearchHandler>

It works fine:

Screenshot_1657724057

On DogsPage there's also a search handler that searches the dogs data:

    <Shell.SearchHandler>
        <controls:AnimalSearchHandler Placeholder="Enter search term"
                                      ShowsResults="true"
                                      ItemTemplate="{StaticResource AnimalSearchTemplate}"
                                      Animals="{x:Static data:DogData.Dogs}"
                                      SelectedItemNavigationTarget="{x:Type views:DogDetailPage}" />
    </Shell.SearchHandler>

However, using this search handler searches the cats data:

Screenshot_1657724070

This problem is only occurring for bottom tabs that also contain top tabs. For the elephants/monkeys/bears page the search handlers work as expected.

The problem might also occur on platforms other than Android, but right now in SR2 the app crashes on iOS/MacCatalyst, and on Windows the search handler doesn't template the results.

Repo: Xaminals.zip

Steps to Reproduce

  1. Run the attached sample on Android.
  2. Navigate to the Dogs top tab and search for dogs data. It searches cats data.

Version with bug

6.0.408

Last version that worked well

Unknown/Other

Affected platforms

Android

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-shellShell Navigation, Routes, Tabs, Flyoutpartner/syncfusionIssues / PR's with Syncfusion collaborationplatform/androids/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions