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

Merged
merged 2 commits into from
Dec 9, 2024

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).

@kubaflo kubaflo requested a review from jsuarezruiz November 15, 2024 00:31
<ContentPage>
<Shell.SearchHandler>
<SearchHandler
SearchBoxVisibility="Expanded"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to add AutomationId("searchHandler") and click this in the UI test, but Appium couldn't find it :/

@PureWeen
Copy link
Member

PureWeen commented Dec 5, 2024

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen
Copy link
Member

PureWeen commented Dec 6, 2024

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen dismissed jsuarezruiz’s stale review December 6, 2024 22:11

Changes addressed

@PureWeen PureWeen modified the milestones: .NET 9 SR2, .NET 9 SR3 Dec 6, 2024
@PureWeen PureWeen merged commit 1c4f5a3 into dotnet:main Dec 9, 2024
104 checks passed
@samhouts samhouts added fixed-in-net9.0-nightly This may be available in a nightly release! fixed-in-net8.0-nightly This may be available in a nightly release! labels Dec 16, 2024
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 fixed-in-net8.0-nightly This may be available in a nightly release! fixed-in-net9.0-nightly This may be available in a nightly release! platform/android 🤖
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Android] SearchHandler.Focused event never fires
6 participants