Skip to content

Commit d52c3e9

Browse files
authored
docs(refresher): add rubber band effect for virtual scroll (#3345)
1 parent 96750d7 commit d52c3e9

File tree

6 files changed

+112
-0
lines changed

6 files changed

+112
-0
lines changed

docs/api/refresher.md

+22
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,28 @@ The native refreshers can be disabled by setting the `pullingIcon` on the [refre
6767

6868
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.
6969

70+
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:
71+
72+
```css
73+
.ion-content-scroll-host::before,
74+
.ion-content-scroll-host::after {
75+
position: absolute;
76+
77+
width: 1px;
78+
height: 1px;
79+
80+
content: "";
81+
}
82+
83+
.ion-content-scroll-host::before {
84+
bottom: -1px;
85+
}
86+
87+
.ion-content-scroll-host::after {
88+
top: -1px;
89+
}
90+
```
91+
7092
import CustomScrollTarget from '@site/static/usage/v7/refresher/custom-scroll-target/index.md';
7193

7294
<CustomScrollTarget />

static/usage/v7/refresher/custom-scroll-target/angular/example_component_css.md

+18
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,22 @@
77
width: 100%;
88
overflow-y: auto;
99
}
10+
11+
.ion-content-scroll-host::before,
12+
.ion-content-scroll-host::after {
13+
position: absolute;
14+
15+
width: 1px;
16+
height: 1px;
17+
18+
content: '';
19+
}
20+
21+
.ion-content-scroll-host::before {
22+
bottom: -1px;
23+
}
24+
25+
.ion-content-scroll-host::after {
26+
top: -1px;
27+
}
1028
```

static/usage/v7/refresher/custom-scroll-target/demo.html

+18
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,24 @@
1818
width: 100%;
1919
overflow-y: auto;
2020
}
21+
22+
.ion-content-scroll-host::before,
23+
.ion-content-scroll-host::after {
24+
position: absolute;
25+
26+
width: 1px;
27+
height: 1px;
28+
29+
content: '';
30+
}
31+
32+
.ion-content-scroll-host::before {
33+
bottom: -1px;
34+
}
35+
36+
.ion-content-scroll-host::after {
37+
top: -1px;
38+
}
2139
</style>
2240
</head>
2341

static/usage/v7/refresher/custom-scroll-target/javascript.md

+18
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,23 @@
3535
width: 100%;
3636
overflow-y: auto;
3737
}
38+
39+
.ion-content-scroll-host::before,
40+
.ion-content-scroll-host::after {
41+
position: absolute;
42+
43+
width: 1px;
44+
height: 1px;
45+
46+
content: '';
47+
}
48+
49+
.ion-content-scroll-host::before {
50+
bottom: -1px;
51+
}
52+
53+
.ion-content-scroll-host::after {
54+
top: -1px;
55+
}
3856
</style>
3957
```

static/usage/v7/refresher/custom-scroll-target/react/main_css.md

+18
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,22 @@
77
width: 100%;
88
overflow-y: auto;
99
}
10+
11+
.ion-content-scroll-host::before,
12+
.ion-content-scroll-host::after {
13+
position: absolute;
14+
15+
width: 1px;
16+
height: 1px;
17+
18+
content: '';
19+
}
20+
21+
.ion-content-scroll-host::before {
22+
bottom: -1px;
23+
}
24+
25+
.ion-content-scroll-host::after {
26+
top: -1px;
27+
}
1028
```

static/usage/v7/refresher/custom-scroll-target/vue.md

+18
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,23 @@
4545
width: 100%;
4646
overflow-y: auto;
4747
}
48+
49+
.ion-content-scroll-host::before,
50+
.ion-content-scroll-host::after {
51+
position: absolute;
52+
53+
width: 1px;
54+
height: 1px;
55+
56+
content: '';
57+
}
58+
59+
.ion-content-scroll-host::before {
60+
bottom: -1px;
61+
}
62+
63+
.ion-content-scroll-host::after {
64+
top: -1px;
65+
}
4866
</style>
4967
```

0 commit comments

Comments
 (0)