Skip to content

Commit 733cb49

Browse files
authored
feat(virtual-scroll): usage with custom scroll target (#2229)
1 parent 8037cb3 commit 733cb49

File tree

3 files changed

+42
-6
lines changed

3 files changed

+42
-6
lines changed

docs/angular/virtual-scroll.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,19 @@ cdk-virtual-scroll-viewport {
110110

111111
Since the viewport is built to fit various use cases, the default sizing is not set and is up to developers to set.
112112

113-
## A Note on Ionic Components
113+
## Usage with Ionic Components
114114

115-
Certain Ionic Framework functionality is currently not compatible with virtual scrolling. Features such as collapsible large titles, `ion-infinite-scroll`, and `ion-refresher` rely on being able to scroll on `ion-content` itself, and as a result will not work when using virtual scrolling.
115+
Ionic Framework requires that features such as collapsible large titles, `ion-infinite-scroll`, `ion-refresher`, and `ion-reorder-group` be used within an `ion-content`. To use these experiences with virtual scrolling, you must add the `.ion-content-scroll-host` class to the virtual scroll viewport.
116116

117-
We are working to improve compatibility between these components and virtual scrolling solutions. You can follow progress and give feedback here: https://github.com/ionic-team/ionic-framework/issues/23437.
117+
For example:
118+
119+
```html
120+
<ion-content [scrollY]="false">
121+
<cdk-virtual-scroll-viewport class="ion-content-scroll-host">
122+
<!-- Your existing content and configurations -->
123+
</cdk-virtual-scroll-viewport>
124+
</ion-content>
125+
```
118126

119127
## Further Reading
120128

docs/react/virtual-scroll.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,22 @@ Certain Ionic Framework functionality is currently not compatible with virtual s
5757

5858
We are working to improve compatibility between these components and virtual scrolling solutions. You can follow progress and give feedback here: https://github.com/ionic-team/ionic-framework/issues/23437.
5959

60+
## Usage with Ionic Components
61+
62+
Ionic Framework requires that features such as collapsible large titles, `ion-infinite-scroll`, `ion-refresher`, and `ion-reorder-group` be used within an `ion-content`. To use these experiences with virtual scrolling, you must add the `.ion-content-scroll-host` class to the virtual scroll viewport.
63+
64+
For example:
65+
66+
```tsx
67+
<IonPage>
68+
<IonContent scrollY={false}>
69+
<Virtuoso className="ion-content-scroll-host">
70+
{/* Your existing content and configurations */}
71+
</Virtuoso>
72+
</IonContent>
73+
</IonPage>
74+
```
75+
6076
## Further Reading
6177

6278
This guide only covers a small portion of what `Virtuoso` is capable of. For more details, please see the [Virtuoso documentation](https://virtuoso.dev/).

docs/vue/virtual-scroll.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,23 @@ Now that our template is setup, we need to add some CSS to size the virtual scro
116116
}
117117
```
118118

119-
## A Note on Ionic Components
119+
## Usage with Ionic Components
120120

121-
Certain Ionic Framework functionality is currently not compatible with virtual scrolling. Features such as collapsible large titles, `ion-infinite-scroll`, and `ion-refresher` rely on being able to scroll on `ion-content` itself, and as a result will not work when using virtual scrolling.
121+
Ionic Framework requires that features such as collapsible large titles, `ion-infinite-scroll`, `ion-refresher`, and `ion-reorder-group` be used within an `ion-content`. To use these experiences with virtual scrolling, you must add the `.ion-content-scroll-host` class to the virtual scroll viewport.
122122

123-
We are working to improve compatibility between these components and virtual scrolling solutions. You can follow progress and give feedback here: https://github.com/ionic-team/ionic-framework/issues/23437.
123+
For example:
124+
125+
```html
126+
<template>
127+
<ion-page>
128+
<ion-content :scroll-y="false">
129+
<RecycleScroller class="ion-content-scroll-host scroller">
130+
<!-- Your existing content and configurations -->
131+
</RecycleScroller>
132+
</ion-content>
133+
</ion-page>
134+
</template>
135+
```
124136

125137
## Further Reading
126138

0 commit comments

Comments
 (0)