-
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
[iOS] SwipeView: Fix reenabling parent scrolling after cancelled swipe #23442
Conversation
Hey there @filipnavara! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
I think this PR is correct, but I think this may need a nice (complicated) UI test :) If you are feeling up to it, you can write a test emulating the human, but I can also give that a go and see who wins :) |
Technically the PR is probably correct with regards to the code intention. After few iterations on our app and with our in-house testers we ended up doing something different though. We ended up fixing all iOS gesture recognisers to correctly report back state to the system and to interact with other gesture recognisers. I’ll try to write up the details tomorrow. The issue with that approach is that it changes the behaviour for minimum swipe needed to open the SwipeView (which is desirable in our case but may not be desirable in general). |
Sorry, took me a little while longer, but let's expand on my previous comment. iOS uses the Naturally, the preferred model for cooperation of multiple gesture recognizers (as is the case here with swiping and collection view scrolling) is to properly implement the state machines and So, how would implementing that look for
Pretty simple, right? Where's the catch? Well, there are multiple catches with this approach:
I'm not quite sure how to follow up from here. We definitely should create a test, as you said. UI tests of this kind are not exactly my turf. I'd be happy to leave it up for someone else to do it, or at least point me in the right direction where a similar test already exists. Going forward we have few options:
|
Wow! Thanks for that. I really like the idea for removing our hacks even if it loses the threshold stuff, but that is just me and we can't just break/change things. So I have pinged the team to make sure we have a chat on this. |
With regards to the nice fix using the ShouldBegin in your diff, how does the method args fire? If you return false for a small threshold will it fire again so we can say yes later? For example, the line is this Can that line be update to include a threshold check and then when it is reached we return true? Or is it too late? You said
What makes you think that? I am no iOS gesture expert so I don't really know how they work. |
It only fires once, unfortunately. That means detecting a bigger threshold makes the task much more difficult since you have to start dealing with two gesture recognizers operating at the same time and then use |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
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.
Tested here both before and after the changes.
It was a bit tricky but definitely possible to get things into a bad state before the changes, and I was unable to break things after testing with the changes.
Appreciate the thorough explanation of things here, and while yes it would be great to eventually do this more properly, this fixes a current issue with a minimal change.
Given the nature of trying to create a test for this (and I think anything we created could likely be inconsistent and unreliable), we should bring this change in now.
Description of Change
Fixes an issue where scrolling of SwipeView's parent is disabled during swipe but not reenabled when the swipe is cancelled by manually moving the touch below the threshold.
Issues Fixed
Fixes #23441
Fixes #16856