-
Notifications
You must be signed in to change notification settings - Fork 368
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
Unable to swipe/drag between values with new iOS modal presentation style #148
Comments
Some screen recordings: |
I've confirmed that This might be helpful: https://stackoverflow.com/questions/56718552/disable-gesture-to-pull-down-form-page-sheet-modal-presentation |
Here is the workaround I am using now based on the stackoverflow answer above. It's very naive but it works. Let me know if this would make for a good PR. There are probably some other consequences I am not considering here.
|
Hi @benpackard. Holy! This is an amazing bug report, thank you very much. And thanks for finding a workaround ( However, I noticed that this workaround changes things a bit when Cosmos view is inside a table view. In order to see that, click "Performance button" in the top right corner of the Demo app, as shown on Fig. 1. It will show a table view with many rating controls. Now, without your workaround, one can scroll through the table view by touching anywhere in the table view, including a cosmos view (see Fig. 2). After I included your workaround, however, I could not scroll the table when my scroll gesture started within a Cosmos view. What do you think we should do here? If we add this workaround as it is, it might introduce these scrolling issues to existing apps and people will be angry. Maybe we can add a flag in Cosmos settings, cosmosView.settings.disablePanGenstures = true in order to make Cosmos work in the modal screens? Figure 1: Opening a table view in a demo app Figure 2: Scrolling table view by first touching the Cosmos rating view. |
@evgenyneu A flag sounds like the right path forward. I do wonder though what happens for a table view in a modal, where the user might need both behaviors. If I get some time this evening I'll test that scenario out. |
@benpackard, thanks. Feel free to submit a pull request, if you want. |
Submitted a pull request, hope I didn't miss anything! |
I ran into this problem and solved using the flag mentioned above. Thanks! My preferred fix (without knowing much about the implementation) would be that pan events that are initially mostly vertical are allowed and lets the user scroll the parent view, but that mostly horizontal pan events are captured and used to adjust the rating. Would this be possible? This behaviour is common throughout iOS, one example is the Mail app. If you begin swiping a mail horizontally it's not possible to scroll the list until you've ended the gesture, and the other way around. |
iOS 13 introduced a new default modal presentation style that allows the user to dismiss with a downwards gesture. Unfortunately this interferes with dragging from one star rating to another in Cosmos.
To reproduce:
CosmosView
to a view controller and present it modally on iOS 13.Expected: the star rating changes as the user drags her finger
Actual: the star rating does not change
A few observations:
CosmosView
works as expected if the view controller'smodalPresentationStyle
is changed to.fullScreen
canCancelContentTouches
tofalse
does not seem to help.passTouchesToSuperview
tofalse
does not help.The text was updated successfully, but these errors were encountered: