Skip to content

Commit

Permalink
docs(refresher): add rubber band effect for virtual scroll (#3346)
Browse files Browse the repository at this point in the history
  • Loading branch information
liamdebeasi authored Dec 21, 2023
1 parent ddb2048 commit 34e8d2f
Show file tree
Hide file tree
Showing 12 changed files with 224 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/api/refresher.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,28 @@ The native refreshers can be disabled by setting the `pullingIcon` on the [refre

Refresher requires a scroll container to function. When using a virtual scrolling solution, you will need to disable scrolling on the `ion-content` and indicate which element container is responsible for the scroll container with the `.ion-content-scroll-host` class target.

Developers should apply the following CSS to the scrollable container. This CSS adds a "rubber band" scrolling effect on iOS which allows the native iOS refresher to work properly:

```css
.ion-content-scroll-host::before,
.ion-content-scroll-host::after {
position: absolute;

width: 1px;
height: 1px;

content: "";
}

.ion-content-scroll-host::before {
bottom: -1px;
}

.ion-content-scroll-host::after {
top: -1px;
}
```

import CustomScrollTarget from '@site/static/usage/v8/refresher/custom-scroll-target/index.md';

<CustomScrollTarget />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,22 @@
width: 100%;
overflow-y: auto;
}

.ion-content-scroll-host::before,
.ion-content-scroll-host::after {
position: absolute;

width: 1px;
height: 1px;

content: '';
}

.ion-content-scroll-host::before {
bottom: -1px;
}

.ion-content-scroll-host::after {
top: -1px;
}
```
18 changes: 18 additions & 0 deletions static/usage/v7/refresher/custom-scroll-target/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,24 @@
width: 100%;
overflow-y: auto;
}

.ion-content-scroll-host::before,
.ion-content-scroll-host::after {
position: absolute;

width: 1px;
height: 1px;

content: '';
}

.ion-content-scroll-host::before {
bottom: -1px;
}

.ion-content-scroll-host::after {
top: -1px;
}
</style>
</head>

Expand Down
18 changes: 18 additions & 0 deletions static/usage/v7/refresher/custom-scroll-target/javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,23 @@
width: 100%;
overflow-y: auto;
}
.ion-content-scroll-host::before,
.ion-content-scroll-host::after {
position: absolute;
width: 1px;
height: 1px;
content: '';
}
.ion-content-scroll-host::before {
bottom: -1px;
}
.ion-content-scroll-host::after {
top: -1px;
}
</style>
```
18 changes: 18 additions & 0 deletions static/usage/v7/refresher/custom-scroll-target/react/main_css.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,22 @@
width: 100%;
overflow-y: auto;
}

.ion-content-scroll-host::before,
.ion-content-scroll-host::after {
position: absolute;

width: 1px;
height: 1px;

content: '';
}

.ion-content-scroll-host::before {
bottom: -1px;
}

.ion-content-scroll-host::after {
top: -1px;
}
```
18 changes: 18 additions & 0 deletions static/usage/v7/refresher/custom-scroll-target/vue.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,23 @@
width: 100%;
overflow-y: auto;
}
.ion-content-scroll-host::before,
.ion-content-scroll-host::after {
position: absolute;
width: 1px;
height: 1px;
content: '';
}
.ion-content-scroll-host::before {
bottom: -1px;
}
.ion-content-scroll-host::after {
top: -1px;
}
</style>
```
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,22 @@
width: 100%;
overflow-y: auto;
}

.ion-content-scroll-host::before,
.ion-content-scroll-host::after {
position: absolute;

width: 1px;
height: 1px;

content: '';
}

.ion-content-scroll-host::before {
bottom: -1px;
}

.ion-content-scroll-host::after {
top: -1px;
}
```
18 changes: 18 additions & 0 deletions static/usage/v8/refresher/custom-scroll-target/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,24 @@
width: 100%;
overflow-y: auto;
}

.ion-content-scroll-host::before,
.ion-content-scroll-host::after {
position: absolute;

width: 1px;
height: 1px;

content: '';
}

.ion-content-scroll-host::before {
bottom: -1px;
}

.ion-content-scroll-host::after {
top: -1px;
}
</style>
</head>

Expand Down
18 changes: 18 additions & 0 deletions static/usage/v8/refresher/custom-scroll-target/javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,23 @@
width: 100%;
overflow-y: auto;
}
.ion-content-scroll-host::before,
.ion-content-scroll-host::after {
position: absolute;
width: 1px;
height: 1px;
content: '';
}
.ion-content-scroll-host::before {
bottom: -1px;
}
.ion-content-scroll-host::after {
top: -1px;
}
</style>
```
18 changes: 18 additions & 0 deletions static/usage/v8/refresher/custom-scroll-target/react/main_css.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,22 @@
width: 100%;
overflow-y: auto;
}

.ion-content-scroll-host::before,
.ion-content-scroll-host::after {
position: absolute;

width: 1px;
height: 1px;

content: '';
}

.ion-content-scroll-host::before {
bottom: -1px;
}

.ion-content-scroll-host::after {
top: -1px;
}
```
18 changes: 18 additions & 0 deletions static/usage/v8/refresher/custom-scroll-target/vue.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,23 @@
width: 100%;
overflow-y: auto;
}
.ion-content-scroll-host::before,
.ion-content-scroll-host::after {
position: absolute;
width: 1px;
height: 1px;
content: '';
}
.ion-content-scroll-host::before {
bottom: -1px;
}
.ion-content-scroll-host::after {
top: -1px;
}
</style>
```
22 changes: 22 additions & 0 deletions versioned_docs/version-v7/api/refresher.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,28 @@ The native refreshers can be disabled by setting the `pullingIcon` on the [refre

Refresher requires a scroll container to function. When using a virtual scrolling solution, you will need to disable scrolling on the `ion-content` and indicate which element container is responsible for the scroll container with the `.ion-content-scroll-host` class target.

Developers should apply the following CSS to the scrollable container. This CSS adds a "rubber band" scrolling effect on iOS which allows the native iOS refresher to work properly:

```css
.ion-content-scroll-host::before,
.ion-content-scroll-host::after {
position: absolute;

width: 1px;
height: 1px;

content: '';
}

.ion-content-scroll-host::before {
bottom: -1px;
}

.ion-content-scroll-host::after {
top: -1px;
}
```

import CustomScrollTarget from '@site/static/usage/v7/refresher/custom-scroll-target/index.md';

<CustomScrollTarget />
Expand Down

0 comments on commit 34e8d2f

Please sign in to comment.