-
Notifications
You must be signed in to change notification settings - Fork 6k
Fix iOS key events in platform views #25365
Conversation
This is based on the UIKey introduction in 13.4
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
chinmaygarde
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UIResponder documentation does state the following:
"When creating your own subclasses, call super to forward any events that you do not handle yourself."
So the patch is sound. I am not sure if Flutter has affordances to consume the key event and prevent it from propagation. To answer that and guidance on testing cc @gaaclarke
@chinmaygarde My reading of this is that you should be calling
Here is where you can add unit tests: https://github.com/flutter/engine/blob/master/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm I have concerns about the ramifications of sending the events to |
|
The assumption for this PR was the following (just for clarification): The current implementation (with this PR merged) restores the original flow of the events (with the addition of making the |
|
Fair point. And I don't think there is a way for the framework to intervene on event propagation on the platform thread anyway. In the sprit of restoring the old behavior, I think this approach is fine. Any updates on the integration test per Aarons last comment? |
|
I will try to get to it this weekend or early next week. |
|
I might have encountered a potential issue. I am not that expierenced when it comes to iOS SDKs, but it looks like the integration tests are using an iOS 13.0 Simulator (which is the metal SDK baseline for the simulator i believe). The key events were only added in 13.4, so the test probably also need to run at least on 13.4. Is my assumption wrong, and if not is there something i can/should do? |
|
@gaaclarke @cbracken Should we have a chat about what the behavior ought to be? I feel like we haven't answered that question yet. |
|
May I add a cal entry for a face to face sync on this? I feel like we are a bit directionless here. |
chinmaygarde
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were trying to reason about the side effects of this patch in a quick conversation. I think this should land for the following reasons:
- This is a regression introduced after #20972.
- This won't mess with existing touch interceptors in Flutter because the those views are children in the touch responder chain.
Sorry it took a while to sort this out as I wasn't sure about the direction here. Testing this is going to be hard without without the simulator availability. Landing this as is. Thanks for the patch.
cbracken
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm after in-person sync on this.
|
This pull request is not suitable for automatic merging in its current state.
|
|
This needs to be rebased before landing. I'll do it later today. |
|
@chinmaygarde (Sorry for disturbing you.) |
me too |
|
I've rebased locally, but don't have permissions to push to the @KammererTob, if you're able to rebase against tip-of-tree and git push, we can land this patch; otherwise, I'm more than happy to land #26412, which is the same patch (but rebased) and has you has author on the commit. Let us know which way you'd like to go, and thanks again for your patch! |
|
Landed in #26412 -- thanks again for the fix! |
This PR fixes key events not getting passed through to platform views in iOS (regression introduced here: #20972). The only change made was calling the
supermethod in the event handlers.I haven't added any tests because i was unsure where to put them. So maybe someone more knowledgeable can help here.
flutter/flutter#74044
Pre-launch Checklist
writing and running engine tests.
///).