Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a3b17ae
fix: [#167] - passive event listener
Feb 17, 2020
3555f09
add: postinstall script
kraftwerk28 Jun 30, 2020
d2bd9e5
Merge branch 'master' of github.com:kraftwerk28/react-swipeable into …
kraftwerk28 Jul 1, 2020
f86fefd
fix: npm install script
kraftwerk28 Jul 1, 2020
da67d4a
fix: remove install script
kraftwerk28 Jul 1, 2020
1be0e2d
fix: prevent inf install hook
kraftwerk28 Jul 1, 2020
676f86e
fix: building package in install hook
kraftwerk28 Jul 1, 2020
644f1d9
chore: update package.json
kraftwerk28 Jul 1, 2020
e8660ea
chore: remove files field from package.json
kraftwerk28 Jul 1, 2020
310c812
chore: update package.json
kraftwerk28 Jul 1, 2020
0e874b2
refactor: linting
kraftwerk28 Jul 1, 2020
bdca104
fix: remove passive modifier from mouse event
kraftwerk28 Jul 2, 2020
ec86676
chore: move build stage to sh script
kraftwerk28 Jul 3, 2020
e2b91a2
fix: chmod build.sh
kraftwerk28 Jul 3, 2020
a7a673d
add: build.sh shebang
kraftwerk28 Jul 3, 2020
dbbde7c
fix: build.sh
kraftwerk28 Jul 3, 2020
375b836
fix: build.sh
kraftwerk28 Jul 3, 2020
73cdc25
fix: build script
kraftwerk28 Jul 3, 2020
61cd234
fix: build script
kraftwerk28 Jul 3, 2020
824ef6e
fix: postinstall script
kraftwerk28 Jul 3, 2020
d43d984
fix: postinstall script
kraftwerk28 Jul 3, 2020
3f0b7ce
fix: postinstall script
kraftwerk28 Jul 3, 2020
cc769f0
fix: npm scripts
kraftwerk28 Jul 3, 2020
499151c
fix: npm scripts
kraftwerk28 Jul 3, 2020
57edc58
fix: npm scripts
kraftwerk28 Jul 3, 2020
cb41ce5
fix: npm scripts
kraftwerk28 Jul 3, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env sh
if [ -f is-installed ]; then
echo "Skipping installation hook."
rm -f is-installed
else
echo > is-installed
npm install
npm run build
rm -rf node_modules package-lock.json
fi
13 changes: 3 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,17 @@
"build": "rollup -c",
"build:examples": "cd ./examples && npm install && npm run build",
"build:publish:examples": "npm run build:examples && rimraf examples/node_modules && gh-pages -d examples",
"clean": "rimraf lib es",
"clean": "rm -rf lib es",
"format": "prettier --write '{src,__{tests,mocks}__}/**/*.js'",
"lint": "eslint .",
"prebuild": "npm run clean",
"prepare": "npm run build",
"pretest": "npm run lint",
"size": "size-limit",
"start:examples": "cd ./examples && npm install && npm run start:dev",
"test": "npm run test:unit && npm run dtslint && npm run build && npm run size",
"test:unit": "jest",
"test:cover": "jest --coverage",
"dtslint": "dtslint types"
"dtslint": "dtslint types",
"install": "./build.sh"
},
"size-limit": [
{
Expand Down Expand Up @@ -57,12 +56,6 @@
"url": "https://github.com/FormidableLabs/react-swipeable/issues"
},
"homepage": "https://github.com/FormidableLabs/react-swipeable",
"files": [
"lib",
"es",
"src",
"types/index.d.ts"
],
"license": "MIT",
"types": "types",
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function getHandlers(set, handlerProps) {
if (el && el.addEventListener) {
// attach touch event listeners and handlers
const tls = [[touchStart, onStart], [touchMove, onMove], [touchEnd, onEnd]]
tls.forEach(([e, h]) => el.addEventListener(e, h))
tls.forEach(([e, h]) => el.addEventListener(e, h, { passive: true }))
// return properly scoped cleanup method for removing listeners
return () => tls.forEach(([e, h]) => el.removeEventListener(e, h))
}
Expand Down