Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] SearchHandler - added focus/unfocus support #24852

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kubaflo
Copy link
Contributor

@kubaflo kubaflo commented Sep 21, 2024

Description of Change

Added a missing support for focus/unfocus events. Implemented it similar to how it has been done for iOS
(https://github.dev/kubaflo/maui/blob/8921d3bfab72dc78aba940020a6b2ea06a708408/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/SearchHandlerAppearanceTracker.cs#L32-L49)

Issues Fixed

Fixes #24670

Screen.Recording.2024-09-21.at.03.00.41.mov

@kubaflo kubaflo requested a review from a team as a code owner September 21, 2024 01:10
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Sep 21, 2024
@kubaflo kubaflo added platform/android 🤖 area-controls-shell Shell Navigation, Routes, Tabs, Flyout area-controls-searchbar SearchBar control labels Sep 21, 2024
@jfversluis
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@rmarinho
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@rmarinho rmarinho requested review from jfversluis and rmarinho and removed request for mattleibow September 27, 2024 11:36
@rmarinho rmarinho added this to the .NET 9 SR1 milestone Sep 27, 2024
[Test]
[Category(UITestCategories.Shell)]
[Category(UITestCategories.SearchBar)]
public void SearchHandlerFocusAndUnfocusEventsShouldWork()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is failing on Android. Maybe need to use WaitForElement before Click the Button.

System.NullReferenceException : Object reference not set to an instance of an object.
 at UITest.Appium.HelperExtensions.Click(IUIElement element) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 154
   at UITest.Appium.HelperExtensions.Click(IApp app, String element) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 34
   at Microsoft.Maui.TestCases.Tests.Issues.Issue24670.SearchHandlerFocusAndUnfocusEventsShouldWork() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24670.cs:line 20
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-searchbar SearchBar control area-controls-shell Shell Navigation, Routes, Tabs, Flyout community ✨ Community Contribution platform/android 🤖
Projects
Status: Changes Requested
Development

Successfully merging this pull request may close these issues.

[Android] SearchHandler.Focused event never fires
5 participants