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
21.82k stars 1.66k forks source link

SearchBar Focused and Unfocused not working on iOS #16580

Open vasile135 opened 11 months ago

vasile135 commented 11 months ago

Description

The event handler for the Focused and Unfocused SearchBar events are never called on iOS. Works on Android.

Steps to Reproduce

Create a SearchBar with Focused and Unfocused event handlers: <SearchBar Placeholder="Focus me" Focused="SearchBar_Focused" Unfocused="SearchBar_Unfocused"/> Code behind: void SearchBar_Focused(System.Object sender, Microsoft.Maui.Controls.FocusEventArgs e) { DisplayAlert("Focused", "Focused", "OK"); }

void SearchBar_Unfocused(System.Object sender, Microsoft.Maui.Controls.FocusEventArgs e) { DisplayAlert("Unfocused", "Unfocused", "OK"); } The SearchBar_Focused and SearchBar_Unfocused are never called. Workloads: image

Link to public reproduction project repository

https://github.com/vasile135/MAUISearchBarTest

Version with bug

7.0.92

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 16.4

Did you find any workaround?

No response

Relevant log output

No response

ghost commented 11 months ago

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.

XamlTest commented 10 months ago

Verified this on Visual Studio Enterprise 17.8.0 Preview 1.0. Repro on iOS 16.4 .NET 8, not repro on Android 13.0-API33 with below Project: SearchBarTest.zip Android: Android iOS: Focus SearchBar events can he called, but Unfocused SearchBar events are never called. iOS

Jean-RochSDX commented 8 months ago

What is the status on this issue? It was working fine for me on .NET 7. I upgraded my project to .NET 8 and it's not working anymore. Is it plan to fix this before the official release in November? Because this is quite a base functionality.

Bennynation commented 6 months ago

Is there any news about this issue or a known workaround ? The problem still seems to exist in .net 8.

mnxamdev commented 4 months ago

This isn't working in .Net 7. What's the update on the fix for this?