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
Conversation
@@ -252,7 +253,23 @@ export class ItemSliding implements ComponentInterface { | |||
return !!(this.rightOptions || this.leftOptions); | |||
} | |||
|
|||
private toggleContentScrollY() { | |||
const content = this.el.closest('ion-content'); |
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.
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(); |
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.
Any chance we could make these disable/enable functions rather than a toggle? I think it's a bit easier to read that way.
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.
Made this change and I agree it is much more readable, ty.
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 |
Please open a new issue with a code reproduction, and we can take a look. |
Will do. Thanks |
resolves #19564
Pull request checklist
Please check if your PR fulfills the following requirements:
npm run build
) was run locally and any changes were pushednpm run lint
) has passed locally and any fixes were made for failuresPull request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: resolves #19564
What is the new behavior?
Does this introduce a breaking change?