[Shell] SearchHandler not showing results when using data binding without sub-classing
#5,783 opened on Apr 2, 2019
Repository metrics
- Stars
- (5,644 stars)
- PR merge metrics
- (No merged PRs in 30d)
Description
Description
I know that the main scenario for using SearchHandler is to sub-class it. However, the fact that it has ICommand properties suggests that it can be used without sub-classing, in an MVVM context.
While my bindings resolve below, and the SearchCommand executes and updates SearchResults, the search suggestions never appear:
<Shell.SearchHandler>
<SearchHandler x:Name="searchHandler"
Placeholder="Enter search term"
ShowsResults="true"
BindingContext="{Binding Source={x:Reference self}, Path=BindingContext}"
Command="{Binding SearchCommand}"
CommandParameter="{Binding Source={x:Reference searchHandler}, Path=Query, Mode=OneWay}"
ItemsSource="{Binding SearchResults}"
ItemTemplate="{StaticResource AnimalSearchTemplate}"/>
</Shell.SearchHandler>
This problem occurs both on iOS and Android.
Note: I know there's some cruft in there that shouldn't be required eventually.
Steps to Reproduce
- Run the attached sample.
- Navigate to the Bears page (bottom tab).
- Search for a bear (e.g. panda). Note that the search only happens when the enter key is hit.
Expected Behavior
The search suggestions populates with the search results.
Actual Behavior
No sign of any search suggestions (it may populate but if it does it's removed very quickly).
Basic Information
- Version with issue: 4.0-pre7
- Last known good version: N/A
- IDE: VSMac 8.0
- Platform Target Frameworks:
- iOS: 12.1
- Android: API27