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

feat(virtual-scroll): usage with custom scroll target #2229

Merged
merged 6 commits into from
Apr 8, 2022

Conversation

sean-perkins
Copy link
Contributor

Updates the sections for note regarding Ionic components to include the usage instructions for the custom scroll target.

@vercel
Copy link

vercel bot commented Mar 15, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/ionic/ionic-docs/7M6aXEPUCEyht6FvD4oWTtYACANA
✅ Preview: https://ionic-docs-git-feat-custom-scroll-target-ionic1.vercel.app

Copy link
Contributor

@liamdebeasi liamdebeasi left a comment

Choose a reason for hiding this comment

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

Good to merge once my comment below is addressed.

@lincolnthree
Copy link

lincolnthree commented Apr 8, 2022

Hi all. Please see the following pull request in the Angular CDK, as I believe this will make much of this easier if we can get these features merged: angular/components#24394

This PR adds the ability to provide custom virtual scroll extensions to link with scroll containers. Essentially allowing the virtual-scroller to attach to ion-content's 'main' scrolling element directly (though I am attempting to work with the author to get that feature added / supported.)

Would love your comments & feedback.

@sean-perkins
Copy link
Contributor Author

@lincolnthree that feature change would allow developers to make use of the ion-content's scroll container instead of the virtual scroll container, but the implementation code may be more difficult for implementers to follow:

<ion-content #content>
  <cdk-virtual-scroll-viewport [scrollableElement]="content.getScrollElement() | async">
    ...
 </cdk-virtual-scroll-viewport>
</ion-content>

I don't see any downsides to that feature change, but we would continue to offer this class approach to support all virtual scrolling solutions in all supported frameworks, not just CDK & Angular.

For example, this is how it looks for React, Vue and Angular with the same implementation pattern: https://gist.github.com/sean-perkins/277524ef0e450591907a87acec15af11

Appreciate your feedback and making us aware of that feature/change from Angular!

@sean-perkins sean-perkins merged commit 733cb49 into feature-6.1 Apr 8, 2022
@sean-perkins sean-perkins deleted the feat/custom-scroll-target branch April 8, 2022 15:47
@Albert-Gao
Copy link

with this being merged, i guess this doc is outdated? https://ionicframework.com/docs/react/virtual-scroll#a-note-on-ionic-components :)

@avalanche1
Copy link

@liamdebeasi
Copy link
Contributor

Thanks everyone, I fixed this in #2780.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants