Skip to content

Commit

Permalink
docs(refresher): add rubber band effect for virtual scroll (#3345)
Browse files Browse the repository at this point in the history
  • Loading branch information
liamdebeasi committed Dec 21, 2023
1 parent 96750d7 commit d52c3e9
Show file tree
Hide file tree
Showing 6 changed files with 112 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/v7/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>
```

1 comment on commit d52c3e9

@vercel
Copy link

@vercel vercel bot commented on d52c3e9 Dec 21, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

ionic-docs – ./

ionic-docs-git-main-ionic1.vercel.app
ionic-docs-gqykycf8t.vercel.app
ionic-docs-ionic1.vercel.app

Please sign in to comment.