Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
R
react-pull-to-refresh
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jason.yap
react-pull-to-refresh
Commits
e04e2c62
Commit
e04e2c62
authored
Dec 22, 2017
by
李勇諭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support safari
parent
cb5da6c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
examples/Basic.tsx
examples/Basic.tsx
+2
-2
src/PullToRefresh.tsx
src/PullToRefresh.tsx
+8
-0
No files found.
examples/Basic.tsx
View file @
e04e2c62
...
...
@@ -24,8 +24,8 @@ export class Basic extends React.Component<BasicProps, BasicState> {
pullDownThreshold=
{
200
}
onRefresh=
{
this
.
onRefresh
}
>
<
div
style=
{
{
height
:
"
95
vh
"
,
textAlign
:
"
center
"
}
}
>
<
div
onClick=
{
console
.
log
}
>
PullToRefresh
</
div
>
<
div
style=
{
{
height
:
"
150
vh
"
,
textAlign
:
"
center
"
}
}
>
<
div
>
PullToRefresh
</
div
>
</
div
>
</
PullToRefresh
>
</
div
>
...
...
src/PullToRefresh.tsx
View file @
e04e2c62
...
...
@@ -80,6 +80,7 @@ export class PullToRefresh extends React.Component<PullToRefreshProps, PullToRef
this
.
dragging
=
true
;
this
.
container
.
style
.
transition
=
"
transform 0.2s cubic-bezier(0,0,0.31,1)
"
;
this
.
pullDown
.
style
.
transition
=
"
transform 0.2s cubic-bezier(0,0,0.31,1)
"
;
e
.
preventDefault
();
}
@
autobind
...
...
@@ -93,6 +94,8 @@ export class PullToRefresh extends React.Component<PullToRefreshProps, PullToRef
return
;
}
e
.
preventDefault
();
if
((
this
.
currentY
-
this
.
startY
)
>=
this
.
props
.
pullDownThreshold
)
{
this
.
setState
({
pullToRefreshThresholdBreached
:
true
,
...
...
@@ -135,6 +138,11 @@ export class PullToRefresh extends React.Component<PullToRefreshProps, PullToRef
});
}
@
autobind
private
stopScroll
(
e
)
{
e
.
preventDefault
();
}
private
initContainer
()
{
requestAnimationFrame
(()
=>
{
this
.
container
.
style
.
overflow
=
"
auto
"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment