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
45c2a7b3
Commit
45c2a7b3
authored
Dec 19, 2017
by
李勇諭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix pull height
parent
4407ccb4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
src/PullToRefresh.tsx
src/PullToRefresh.tsx
+5
-4
src/dev.tsx
src/dev.tsx
+6
-6
No files found.
src/PullToRefresh.tsx
View file @
45c2a7b3
...
@@ -89,7 +89,7 @@ export class PullToRefresh extends React.Component<PullToRefreshProps, PullToRef
...
@@ -89,7 +89,7 @@ export class PullToRefresh extends React.Component<PullToRefreshProps, PullToRef
});
});
}
}
if
(
this
.
currentY
-
this
.
startY
>
this
.
state
.
maxPullDownDistance
*
1.5
)
{
if
(
this
.
currentY
-
this
.
startY
>
this
.
state
.
maxPullDownDistance
)
{
return
;
return
;
}
}
...
@@ -99,6 +99,10 @@ export class PullToRefresh extends React.Component<PullToRefreshProps, PullToRef
...
@@ -99,6 +99,10 @@ export class PullToRefresh extends React.Component<PullToRefreshProps, PullToRef
@
autobind
@
autobind
private
onEnd
()
{
private
onEnd
()
{
this
.
dragging
=
false
;
this
.
startY
=
0
;
this
.
currentY
=
0
;
this
.
setState
({
this
.
setState
({
pullToRefreshThresholdBreached
:
false
,
pullToRefreshThresholdBreached
:
false
,
onRefreshing
:
true
,
onRefreshing
:
true
,
...
@@ -110,9 +114,6 @@ export class PullToRefresh extends React.Component<PullToRefreshProps, PullToRef
...
@@ -110,9 +114,6 @@ export class PullToRefresh extends React.Component<PullToRefreshProps, PullToRef
this
.
container
.
style
.
transform
=
"
none
"
;
this
.
container
.
style
.
transform
=
"
none
"
;
this
.
container
.
style
[
"
willChange
"
]
=
"
none
"
;
this
.
container
.
style
[
"
willChange
"
]
=
"
none
"
;
});
});
this
.
dragging
=
false
;
this
.
startY
=
0
;
this
.
currentY
=
0
;
});
});
});
});
}
}
...
...
src/dev.tsx
View file @
45c2a7b3
...
@@ -6,7 +6,7 @@ import {PullToRefresh} from "./PullToRefresh";
...
@@ -6,7 +6,7 @@ import {PullToRefresh} from "./PullToRefresh";
const
onRefresh
=
()
=>
{
const
onRefresh
=
()
=>
{
return
new
Promise
((
reslove
)
=>
{
return
new
Promise
((
reslove
)
=>
{
setTimeout
(
reslove
,
3
000
);
setTimeout
(
reslove
,
1
000
);
});
});
};
};
...
@@ -17,13 +17,13 @@ const renderMasterLayout = () => {
...
@@ -17,13 +17,13 @@ const renderMasterLayout = () => {
<
div
>
<
div
>
<
div
>
Header
</
div
>
<
div
>
Header
</
div
>
<
PullToRefresh
<
PullToRefresh
pullDownContent=
{
<
span
>
pullDownContent
</
span
>
}
pullDownContent=
{
<
div
style=
{
{
backgroundColor
:
"
red
"
,
height
:
"
200px
"
}
}
>
pullDownContent
</
div
>
}
releaseContent=
{
<
span
>
releaseContent
</
span
>
}
releaseContent=
{
<
div
style=
{
{
backgroundColor
:
"
red
"
,
height
:
"
200px
"
}
}
>
releaseContent
</
div
>
}
refreshContent=
{
<
span
>
refreshing
</
span
>
}
refreshContent=
{
<
div
style=
{
{
backgroundColor
:
"
red
"
,
height
:
"
200px
"
}
}
>
refreshContent
</
div
>
}
pullDownThreshold=
{
5
0
}
pullDownThreshold=
{
10
0
}
onRefresh=
{
onRefresh
}
onRefresh=
{
onRefresh
}
>
>
<
div
style=
{
{
backgroundColor
:
"
green
"
,
height
:
"
3
00px
"
,
color
:
"
white
"
,
textAlign
:
"
center
"
}
}
>
<
div
style=
{
{
backgroundColor
:
"
green
"
,
height
:
"
5
00px
"
,
color
:
"
white
"
,
textAlign
:
"
center
"
}
}
>
PullToRefresh
PullToRefresh
</
div
>
</
div
>
</
PullToRefresh
>
</
PullToRefresh
>
...
...
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