Skip to content
This repository was archived by the owner on Sep 28, 2021. It is now read-only.

Commit 231906d

Browse files
authored
Merge pull request #264 from wack17s/swipeDownThreshold
Add Swipe down threshold
2 parents a522f83 + a6c6cf5 commit 231906d

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ export default class App extends React.Component {
9999
| footerContainerStyle | object<br><br>`{someStyle: someValue}` | no | custom style props for container that will be holding your footer that you pass | `bottom: 0, position: "absolute", zIndex: 9999` |
100100
| backgroundColor | string<br><br>`white` | no | Component background color | `black` |
101101
| enableSwipeDown | boolean | no | Enable swipe down to close image viewer. When swipe down, will trigger onCancel. | false |
102+
| swipeDownThreshold | number | no | Threshold for firing swipe down function | |
102103
| doubleClickInterval | number | no | Double click interval. | |
103104
| pageAnimateTime | number | no | Set the animation time for page flipping. | 100 |
104105
| enablePreload | boolean | no | Preload the next image | false |

src/image-viewer.component.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ export default class ImageViewer extends React.Component<Props, State> {
472472
onClick={this.handleClick}
473473
onDoubleClick={this.handleDoubleClick}
474474
enableSwipeDown={this.props.enableSwipeDown}
475+
swipeDownThreshold={this.props.swipeDownThreshold}
475476
onSwipeDown={this.handleSwipeDown}
476477
pinchToZoom={this.props.enableImageZoom}
477478
enableDoubleClickZoom={this.props.enableImageZoom}
@@ -541,6 +542,7 @@ export default class ImageViewer extends React.Component<Props, State> {
541542
imageWidth={width}
542543
imageHeight={height}
543544
enableSwipeDown={this.props.enableSwipeDown}
545+
swipeDownThreshold={this.props.swipeDownThreshold}
544546
onSwipeDown={this.handleSwipeDown}
545547
pinchToZoom={this.props.enableImageZoom}
546548
enableDoubleClickZoom={this.props.enableImageZoom}

src/image-viewer.type.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ export class Props {
6666
*/
6767
public enableSwipeDown?: boolean = false;
6868

69+
/**
70+
* threshold for firing swipe down function
71+
*/
72+
public swipeDownThreshold?: number;
73+
6974
public doubleClickInterval?: number;
7075

7176
/**

0 commit comments

Comments
 (0)