Skip to content

Commit b6f47a3

Browse files
author
Marek Rozmus
committed
Update docs and prop types
1 parent 103ceb0 commit b6f47a3

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ NOTE: `SwipeableListItem` can be used without `SwipeableList` but swipe blocking
6363

6464
## SwipeableList Props
6565

66+
### scrollElement
67+
68+
Type: `EventTarget`
69+
70+
Required to block swipe during scrolling outside of list e.g. set to `window` to block swiping during body scroll.
71+
6672
### threshold
6773

6874
Type: `number`

src/SwipeableList.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ const SwipeableList = ({ children, scrollElement, threshold }) => {
5151

5252
SwipeableList.propTypes = {
5353
children: PropTypes.node,
54-
scrollElement: PropTypes.instanceOf(EventTarget),
54+
scrollElement:
55+
typeof EventTarget !== 'undefined'
56+
? PropTypes.instanceOf(EventTarget)
57+
: PropTypes.any,
5558
threshold: PropTypes.number
5659
};
5760

0 commit comments

Comments
 (0)