diff --git a/src/MAUI/Maui.Samples/Views/SearchPage.xaml.cs b/src/MAUI/Maui.Samples/Views/SearchPage.xaml.cs index 75a8170063..1542b43e70 100644 --- a/src/MAUI/Maui.Samples/Views/SearchPage.xaml.cs +++ b/src/MAUI/Maui.Samples/Views/SearchPage.xaml.cs @@ -13,7 +13,15 @@ public SearchPage() InitializeComponent(); _viewModel = new SearchViewModel(); BindingContext = _viewModel; - } + + // Focus search bar when page loads. + SampleSearchBar.Loaded += SampleSearchBar_Loaded; + } + + private void SampleSearchBar_Loaded(object sender, EventArgs e) + { + SampleSearchBar.Focus(); + } private void TapGestureRecognizer_SearchResultTapped(object sender, TappedEventArgs e) {