Skip to content

[.NET10] Add An API to SearchHandler so users can hide or show the softkeyboard #29600

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

Open
wants to merge 1 commit into
base: net10.0
Choose a base branch
from

Conversation

kubaflo
Copy link
Contributor

@kubaflo kubaflo commented May 20, 2025

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Issues Fixed

Fixes #29559

@Copilot Copilot AI review requested due to automatic review settings May 20, 2025 23:00
@kubaflo kubaflo requested a review from a team as a code owner May 20, 2025 23:00
@kubaflo kubaflo requested review from jfversluis and tj-devel709 May 20, 2025 23:00
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label May 20, 2025
@kubaflo kubaflo self-assigned this May 20, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces public methods to show and hide the soft keyboard via SearchHandler, wires those requests through platform handlers, and adds a UI scenario plus automated tests to verify the behavior.

  • Exposed ShowKeyboard()/HideKeyboard() on SearchHandler with corresponding internal events.
  • Updated iOS and Android appearance trackers to respond to new keyboard events.
  • Added a sample Shell page and UI tests to validate keyboard visibility toggling.

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Controls/src/Core/Shell/SearchHandler.cs Added ShowKeyboard()/HideKeyboard() methods and events.
src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/SearchHandlerAppearanceTracker.cs Subscribed/unsubscribed to new keyboard events.
src/Controls/src/Core/Compatibility/Handlers/Shell/Android/SearchHandlerAppearanceTracker.cs Subscribed/unsubscribed to new keyboard events.
src/Controls/tests/TestCases.HostApp/Issues/Issue29559.xaml Added buttons wired to the new keyboard API.
src/Controls/tests/TestCases.HostApp/Issues/Issue29559.xaml.cs Hooked up show/hide click handlers.
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29559.cs Added UI test for keyboard show/hide.
src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt Published the new API surface.
(and other PublicAPI.Unshipped.txt updates for each target)
Comments suppressed due to low confidence (1)

src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29559.cs:20

  • [nitpick] The variable IskeyboardVisible does not follow camelCase conventions; consider renaming to isKeyboardVisible or similar.
bool IskeyboardVisible = App.IsKeyboardShown();

@@ -0,0 +1,30 @@
#if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST //In windows and mac catalyst, keyboard won't visible on focus and unfocus
Copy link
Preview

Copilot AI May 20, 2025

Choose a reason for hiding this comment

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

The preprocessor condition uses && but should use || so the test is excluded on either Windows or Catalyst, not only when both are defined.

Suggested change
#if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST //In windows and mac catalyst, keyboard won't visible on focus and unfocus
#if TEST_FAILS_ON_WINDOWS || TEST_FAILS_ON_CATALYST //In windows and mac catalyst, keyboard won't visible on focus and unfocus

Copilot uses AI. Check for mistakes.

@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants