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

fix(item-sliding): prevent scrolling during slide gesture #23774

Merged
merged 3 commits into from Aug 18, 2021
Merged

Conversation

willmartian
Copy link
Contributor

resolves #19564

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Build (npm run build) was run locally and any changes were pushed
  • Lint (npm run lint) has passed locally and any fixes were made for failures

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: resolves #19564

What is the new behavior?

  • Scrolling is now disabled during the slide gesture.

Does this introduce a breaking change?

  • Yes
  • No

@github-actions github-actions bot added the package: core @ionic/core package label Aug 16, 2021
@@ -252,7 +253,23 @@ export class ItemSliding implements ComponentInterface {
return !!(this.rightOptions || this.leftOptions);
}

private toggleContentScrollY() {
const content = this.el.closest('ion-content');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we grab the content in connectedCallback so that we do not need to query for it every time the gesture starts?

private onStart() {
// Prevent scrolling during gesture
this.toggleContentScrollY();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance we could make these disable/enable functions rather than a toggle? I think it's a bit easier to read that way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made this change and I agree it is much more readable, ty.

@willmartian willmartian merged commit e0c4ad3 into main Aug 18, 2021
@willmartian willmartian deleted the FW-8 branch August 18, 2021 03:53
@mariossavva
Copy link

This fix has broken the smoothness of appearing/disappearing of the sliding items in ionic 5.6.14. Everything was good till 5.6.13

Screenshot attached

item-sliding.mov

@liamdebeasi
Copy link
Member

liamdebeasi commented Aug 24, 2021

Please open a new issue with a code reproduction, and we can take a look.

@mariossavva
Copy link

Will do. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ionic 4 / Angular: ion-item-option needs to be clicked twice
3 participants