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

iOS handler doesn't intercept keyboard events on the simulator, but it works on a real iPad #16394

Open
JTOne123 opened this issue Jul 27, 2023 · 2 comments
Assignees
Labels
area-keyboard Keyboard, soft keyboard platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@JTOne123
Copy link
Contributor

Description

Hello,

I try to implement an iOS keyboard handler to intercept keyboard events.
image
The full implementation is here https://github.com/JTOne123/MAUI-IOS-KEYBOARD/blob/main/MAUI-IOS-KEYBOARD/MAUI-IOS-KEYBOARD/Platforms/iOS/Handlers/KeyboardManagerHandler.cs

I was able to make it work on real devices; I can intercept key events on my iPad with a keyboard wherever I use it (with compatibility renderer and handler, they both work). But I faced an issue with the simulator.

Whatever the simulator IO/Keyboard settings I changed, there was no difference.

Then I created a Xamarin.Form a project with the same renderer, and I can run it on my simulator alongside the MAUI project. Xamarin project works perfectly on a simulator, I can press a key, and it intercepts the event. It proves that my simulator works well.
image

Then I decided to delete AppShell.xaml from my MAUI project.
image
JTOne123/MAUI-IOS-KEYBOARD@1a72ddb

As a result, the compatibility renderer started to work in the simulator, but no UI is shown; something is broken; I don't know what... Do you know what?
image

But still, the handler doesn't work (UI works)
image
In this image, you can see only the change I made to change between the renderer and handler.
https://github.com/JTOne123/MAUI-IOS-KEYBOARD/blob/main/MAUI-IOS-KEYBOARD/MAUI-IOS-KEYBOARD/MauiProgram.cs

I was wondering, do you have any ideas about this situation?

I appreciate any help.

Steps to Reproduce

  1. Clone my repo
  2. Open solution https://github.com/JTOne123/MAUI-IOS-KEYBOARD/blob/main/MAUI-IOS-KEYBOARD/MAUI-IOS-KEYBOARD/MAUI-IOS-KEYBOARD.csproj
  3. Launch it on a real device - it should work
  4. Launch it on the simulator - it doesn't work
  5. Switch between the compatibility renderer and the handler for another test round.
  6. Launch it again

Link to public reproduction project repository

https://github.com/JTOne123/MAUI-IOS-KEYBOARD

Version with bug

7.0.86

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

ios simulator only

Did you find any workaround?

Do not use a simulator, which is bad for the dev perspective.

Relevant log output

No response

@JTOne123 JTOne123 added the t/bug Something isn't working label Jul 27, 2023
@jsuarezruiz jsuarezruiz added platform/iOS 🍎 area-keyboard Keyboard, soft keyboard labels Jul 27, 2023
@PureWeen PureWeen added this to the Backlog milestone Jul 27, 2023
@ghost
Copy link

ghost commented Jul 27, 2023

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.

@jaosnz-rep
Copy link

Verified this issue with Visual Studio Enterprise 17.9.0 Preview 5. Can repro on iOS platform with sample project.
https://github.com/JTOne123/MAUI-IOS-KEYBOARD

@jaosnz-rep jaosnz-rep added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-keyboard Keyboard, soft keyboard platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants