MacCatalyst WebView keydown events are not captured
nicobarengo opened this issue · comments
Description
On MacOS Ventura when using a WebView, key events are not captured so, for example using tab key to navigate between input fields is not working, also it's its imposible to read the keydown event from javascript.
Steps to Reproduce
- Create a new MAUI App and add a WebView pointing to https://www.toptal.com/developers/keycode or any other website
- Run the App in MacOS Ventura
- Use tab key to navigate between fields and verify that are not captured.
Link to public reproduction project repository
https://github.com/nicobarengo/webview_keydown
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
macOS
Affected platform versions
MacOS Ventura 13
Did you find any workaround?
No, but it works on older versions on MacOS
Relevant log output
No response
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.
I think this is how the implementation of WKWebView works on Catalyst, or a bug with it.
https://github.com/drasticactions/MauiRepros/tree/main/WebviewTestCatalyst
I wrote a .NET Mac Catalyst app (Without the MAUI UI) and loaded the same WKWebView type MAUI uses for its webview, and it operates the same.
https://developer.apple.com/forums/thread/721141
Funny enough, they mention the same site as you.
Nothing can be done within this repo if this is a bug with WKWebView. That would need to be fixed by Apple.
Let's hope apple fixes this, because MAUI Blazor Apps will be the most affected.
Same issue, but in Blazor Hybrid: #12244
I've also confirmed that this is an issue with WKWebView on MacCatalyst, nothing to do with .NET or MAUI. I wrote an app with Xcode and Swift to directly repro this: https://github.com/Eilon/MacCatalystWebViewKeyboard/tree/main
And, sure enough, the exact same issue reproduces.
I'll see how we can contact Apple with this issue so that they can try to address it as soon as possible.
I filed a feedback issue with Apple with ID FB12076485 (I don't think it's publicly visible).
I'll update this issue with anything I hear back.
To anyone seeing this issue: On whichever Mac you are seeing this issue, can you tell us what type of Apple hardware you have?
To find this info:
- On your Mac, click on the Apple logo at the upper-left corner of the screen, then select About This Mac
- It will say "Processor" or "Chip" and next to that it will say either Intel (such as Intel Core i7) or Apple (such as Apple M1)
MBP 16" 2019 - 2.6 GHz 6-Core Intel Core i7 with Ventura 13.2.1
iMac M1 running Ventura 13.2.1
Any news on this? ( I'm on a MacBook Pro M1 Max )
the same issue on MacBook 13 Pro M2 Ventura 13.4
Same issue on MacBook Air 13" 2019 - intel - Ventura :"(
Verified this issue with Visual Studio for Mac 17.6 (build 1575). Can repro on macOS with sample.
https://github.com/nicobarengo/webview_keydown
To anyone seeing this issue: On whichever Mac you are seeing this issue, can you tell us what type of Apple hardware you have?
To find this info:
- On your Mac, click on the Apple logo at the upper-left corner of the screen, then select About This Mac
- It will say "Processor" or "Chip" and next to that it will say either Intel (such as Intel Core i7) or Apple (such as Apple M1)
13.4.1 (22F82), MacBook Air M2
To anyone seeing this issue: On whichever Mac you are seeing this issue, can you tell us what type of Apple hardware you have?
To find this info:
- On your Mac, click on the Apple logo at the upper-left corner of the screen, then select About This Mac
- It will say "Processor" or "Chip" and next to that it will say either Intel (such as Intel Core i7) or Apple (such as Apple M1)
Computer: 16" Macbook Pro, 2021
Processor: Apple M1 Pro
macOS: 13.5.1 (22G90)
Any update from apple support? @Eilon
Any update from apple support? @Eilon
Hi, I just checked again and there is no update from Apple on this.
Same issue. Any update from Apple?
Apple M1 Max
macOS: 14.1.1 (23B81)
Sorry, still no update from Apple.
There may be a resolution here, but I don’t know how to register the permission in Maui? wailsapp/wails#2919
There may be a resolution here, but I don’t know how to register the permission in Maui? wailsapp/wails#2919
Hmm interesting, I'll have to take a look at that!
Here to provide a non-update. I checked the Apple Feedback request again and there is no update from Apple.
All it says now is:
- Recent Similar Reports: Less than 10
- Resolution: Open
So, we wait.
This bug makes Blazor Hybrid on MacOS unusable for any form entry. We can't ship a desktop product where you can't tab between inputs. Without a workaround this is a showstopper for almost every app.
WebView on Mac does seem to have a setting to make this work. https://developer.apple.com/documentation/webkit/wkpreferences/2818595-tabfocuseslinks
Perhaps this is why the bug logged with them is not getting any attention. It was meant to be that way and this is how you change it. Apple may never fix this and waiting on them to change it is not a viable strategy for MAUI.
@Eilon Can this be set in Maui? If not, how do we get this escalated to make it settable or the default?
BTW, I am shocked that there is not better communication between Apple and the MAUI team than a feedback item to address concerns.
It's a macOS property, not MacCatalyst (The one that MAUI uses) or iOS! @scottkuhl
@mhrastegari I hope there is some way to escalate this issue then, since there is no workaround.
...or at least tell us how we can log the same issue with Apple so they don't dismiss it due to low interest.