-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Generalize HideSoftInputOnTapped on Android and iOS to support 3rd party input controls #19626
Generalize HideSoftInputOnTapped on Android and iOS to support 3rd party input controls #19626
Conversation
Hey there @albyrock87! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Can you add tests for this? We have some existing tests for this here. maui/src/Controls/samples/Controls.Sample.UITests/Issues/HideSoftInputOnTappedPage.cs Line 9 in 4091224
|
@PureWeen I think existing unit tests already cover this for the following reasons:
Therefore, the fact that I removed specific reference to
I don't see what other kind of unit test I should add given that search bar is already an example of a native control which contains a text editor. |
Bump! |
Hello, |
@Alexgoon have you seen the workaround I proposed here? I will try to propose a different PR here with that strategy (which is completely different but more effective). |
@albyrock87, thank you very much for your contribution! Yes, we've seen the workaround, and it can definitely be used as a temporary solution by our customers. We've mentioned this technique in the following thread: The Keyboard remains visible on a click outside editors even if the ContentPage.HideSoftInputOnTapped property is enabled However, the workaround requires overriding a MauiAppCompatActivity method, but we would like to fix the issue on our side so that our customers can get a working solution in the default configuration. That's why we are hoping that this PR will be introduced in .NET. However, .NET 9 is too far away, and I'm afraid too many customers may face the issue until a new version is available. |
@Alexgoon if you want to avoid that, you can probably use reflection to add that part of my workaround here:
|
/rebase |
…rty input controls.
40ec49b
to
d9a9f02
Compare
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
Failing tests are unrelated |
Description of Change
Generalize recognition of text inputs in
HideSoftInputOnTappedChangedManager
so that 3rd party libraries with native handlers can leverage this new feature ofContentPage
by simply adding a mapper the same wayInputView
does.Unfortunately
HideSoftInputOnTappedChangedManager
is internal, but they can still use it via reflection.I know it's suboptimal but I didn't want to change public API.
See more at: https://supportcenter.devexpress.com/ticket/details/t1201718/the-keyboard-remains-visible-on-a-click-outside-editors-even-if-the-contentpage