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

bug: card modal content swipe with ion-nav behaves not smooth #25298

Closed
4 of 7 tasks
EinfachHans opened this issue May 17, 2022 · 6 comments · Fixed by #25300
Closed
4 of 7 tasks

bug: card modal content swipe with ion-nav behaves not smooth #25298

EinfachHans opened this issue May 17, 2022 · 6 comments · Fixed by #25300
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@EinfachHans
Copy link
Contributor

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x
  • Nightly

Current Behavior

When using a ion-nav within a card modal and swiping down on the content it looks and feels weird because it moves the modal and scrolls the list at the same time

Expected Behavior

To not scroll the list if the modal is swiped down

Steps to Reproduce

See repo:

  1. ionic capacitor build ios
  2. run on ios device
  3. open modal
  4. forward to list page
  5. swipe down on content

Code Reproduction URL

https://github.com/EinfachHans/ionic-card-modal-swipe-dismiss-issue

Ionic Info

Ionic:

Ionic CLI : 6.19.1 (/Users/hans/.nvm/versions/node/v16.14.2/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 6.1.5
@angular-devkit/build-angular : 13.2.6
@angular-devkit/schematics : 13.2.6
@angular/cli : 13.2.6
@ionic/angular-toolkit : 6.1.0

Capacitor:

Capacitor CLI : 3.5.1
@capacitor/android : not installed
@capacitor/core : 3.5.1
@capacitor/ios : 3.5.1

Utility:

cordova-res (update available: 0.15.4) : 0.15.1
native-run : 1.6.0

System:

NodeJS : v16.14.2 (/Users/hans/.nvm/versions/node/v16.14.2/bin/node)
npm : 8.6.0
OS : macOS Monterey

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label May 17, 2022
@liamdebeasi liamdebeasi self-assigned this May 17, 2022
@liamdebeasi liamdebeasi added type: bug a confirmed bug report package: core @ionic/core package labels May 17, 2022
@ionitron-bot ionitron-bot bot removed the triage label May 17, 2022
@liamdebeasi
Copy link
Contributor

Thanks for the issue. The problem here is we incorrectly assume that the content will remain consistent: https://github.com/ionic-team/ionic-framework/blob/main/core/src/components/modal/gestures/swipe-to-close.ts#L17

When opening the card modal, we grab a reference to the ion-content in the root page. However, after pushing a view the ion-content that we are swiping on has changed. As a result, scrolling is not prevented on that new ion-content when we swipe.

@liamdebeasi
Copy link
Contributor

Can you try the following dev build, and let me know if it resolves the issue?

npm install @ionic/angular@6.1.6-dev.11652813945.183e18c9

@liamdebeasi liamdebeasi removed their assignment May 17, 2022
@EinfachHans
Copy link
Contributor Author

@liamdebeasi works for me 😊

Another questions: What currently works is scrolling and if reached the top the modal dismissing starts within the same gesture. Can the other way around work as well? So when moving the modal to the top and when the top is reached start scrolling the content within the same gesture?

@liamdebeasi
Copy link
Contributor

Sadly, no. Once we disable scrolling, the browser will not dispatch new scroll events while the gesture is still active (even if we remove overflow: hidden).

@liamdebeasi
Copy link
Contributor

Thanks for the issue. This has been resolved via #25300, and a fix will be available in an upcoming release of Ionic Framework.

@ionitron-bot
Copy link

ionitron-bot bot commented Jun 17, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Jun 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants