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
22k stars 1.72k forks source link

[Android] SearchHandler.Focused event never fires #24670

Open peruchali opened 1 week ago

peruchali commented 1 week ago

Description

The Focused event for Shell.SearchHandler does not fire on selecting it, even though the keyboard shows up.

Steps to Reproduce

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MauiApp1.NewPage1"
             Title="NewPage1">
    <Shell.SearchHandler>
        <SearchHandler
            Focused="SearchHandler_Focused"
            Placeholder="Click to focus.." />
    </Shell.SearchHandler>
    <VerticalStackLayout>
        <Label 
            Text="Welcome to .NET MAUI!"
            VerticalOptions="Center" 
            HorizontalOptions="Center" />
    </VerticalStackLayout>
</ContentPage>
namespace MauiApp1;

public partial class NewPage1 : ContentPage
{
    public NewPage1()
    {
        InitializeComponent();
    }

    private void SearchHandler_Focused(object sender, EventArgs e)
    {
        // Set a breakpoint
    }
}

SearchHandler_Focused is never invoked on tapping on the SearchHandler.

Link to public reproduction project repository

No response

Version with bug

8.0.80 SR8

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

No response

Did you find any workaround?

No workaround.

Relevant log output

No response

github-actions[bot] commented 1 week ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

Zhanglirong-Winnie commented 1 week ago

This issue has been verified using Visual Studio 17.12.0 Preview 1.0(8.0.82 & 8.0.80 &8.0.72). Can repro on Android platform.