-
Notifications
You must be signed in to change notification settings - Fork 13.4k
feat(content, reorder-group, header, footer, infinite-scroll, refresher): allow custom scroll target #24883
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
Conversation
@tlaverdure I wanted to update you on the status of this PR, based on decisions the team has discussed privately. The changes for querying that would support detaching from As such, I have removed the referenced issue for the webkit performance bug. With reviewing that issue, there are a few items that stand out to me:
I would be happy to test virtual scroll against your reproduction to see if there are noticeable performance improvements that you can taken advantage of in the interim. I apologize for committing to handling your use case and the end result not addressing it. We will continue to evaluate improvements we can make that would incrementally improve the performance without causing a breaking change (or hold a larger improvement for v7). Thanks for your willingness to test this PR and your continued time in improving Ionic! |
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.
Please be sure to also update the Virtual Scroll docs:
Vue: https://github.com/ionic-team/ionic-docs/blob/main/docs/vue/virtual-scroll.md#a-note-on-ionic-components
Angular: https://github.com/ionic-team/ionic-docs/blob/main/docs/angular/virtual-scroll.md#a-note-on-ionic-components
React: https://github.com/ionic-team/ionic-docs/blob/main/docs/react/virtual-scroll.md#a-note-on-ionic-components
(In particular, the "A Note on Ionic Components" section)
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.
Good to merge once the other 4 points have been addressed. Great job on this 👍
One more thing: Please make sure you update the commit subject to be more descriptive. Maybe something like |
PR to update the docs for virtual scrolling will be tracked here: ionic-team/ionic-docs#2229 |
Hi @sean-perkins, thank you for the good work! Is there a dev build or any other way to test this feature? |
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?
The following components are dependent on an implementation using
ion-content
, which is not compatible in implementations that use a custom scroll container, such as virtual-scroll.Affected components:
ion-header
- fade effect and large titles (iOS)ion-footer
- fade effect (iOS)ion-infinite-scroll
- scrollingion-reorder-group
- ability to drag/reorder itemsion-refresher
- ability to pull to refreshIssue URL: #23437
What is the new behavior?
Developers can make use of a new global CSS class selector:
.ion-content-scroll-host
to specify to implementations using the above components/features, which container is the scroll target to attach listeners to.Developers using a custom scroll containers should additionally consider disabling scrolling on the host
ion-content
to prevent duplicate scroll containers (scroll-y="false"
for vertical scrolling andscroll-x="false"
for horizontal scrolling).ion-header
fade effect can be used with a custom scroll containerion-header
large/collapsible title can be used with a custom scroll containerion-footer
fade effect can be used with a custom scroll containerion-infinite-scroll
can be used with a custom scroll container (emittingionInfinite
when the container reaches threshold)ion-reorder-group
can be used with a custom scroll container (allows reordering elements within target container)ion-refresher
can be used with a custom scroll container (preserves iOS and MD animation effects without needing to specify a custom#background-content
element)All of the above features can be used against virtual scroll implementations.
Does this introduce a breaking change?
Other information
There were many areas of the implementation that were lacking e2e coverage of functionality, the following components had tests filled in, to cover the behavior changed with this PR:
ion-infinite-scroll
,ion-refresher
,ion-footer
(fade effect is exclusive to iOS).