-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V7 #289
Conversation
size-limit report 📦
|
* setup touchEventOptions prop * add onTouchStartOrOnMouseDown prop and test * add onTouchEndOrOnMouseUp callback
FYI: it looks like object spreads still get transpiled, since they're es2018 (I think). So if anyone still wants to support Safari 10 (doesn't support the object spread syntax), the new transpile target should still be fine. e.g.: Lines 115 to 123 in 3e417f5
...becomes (checking my node_modules): return Object.assign(Object.assign(Object.assign({}, state), initialState), { initial: xy.slice(), xy, start: event.timeStamp || 0 }); |
Great callout @robinmetral , I wrote that breaking change note while we were iterating on which compiler/bundler to use. I'll get a PR to clarify this a bit like you noted. 👍 |
New Features:
swipeDuration
prop - "allowable duration of a swipe"swipeDuration
, in milliseconds, will not be considered a swipe.use-gesture
swipe.durationInfinity
for backwards compatibilitytouchEventOptions
prop that can set the options for the touch event listeners{ passive: true }
onTouchStartOrOnMouseDown
prop that is called fortouchstart
andmousedown
. Before a swipe even starts.touchEventOptions
allows users the ability to now callpreventDefault
ontouchstart
onTouchEndOrOnMouseUp
prop that is called fortouchend
andmouseup
.peerDependencies
Breaking Changes:
es5
transpiled outputes2015
for our transpilation nowswipeable
utilizes object/array spread & const/let nativelypreventScrollOnSwipe
- "new" prop. ReplacespreventDefaultTouchmoveEvent
passive
event listener option fortouchmove
depending on this propBug fixes:
undefined
/falsy values to setcancelablePageSwipe
trackTouch
andtrackMouse
were present that triggered an erroneous swipe when the user clicked outside and above the swipeable areaInfrastructure:
size-limit report
to PRs with bundle diff sizesrollup
for build & outputmicrobundle
interop
injected code - pull/260typescript
v4.6.3
react-redux
)package.json
:browser
,umd:main
(renameddist
),jsnext:main
(usemodule
),typings
(usetypes
)"main": "./dist/react-swipeable.js"
=>"main": "./lib/index.js"
"module": "./dist/react-swipeable.module.js"
=>"module": "es/index.js"
"types": "./dist/index.d.ts"
=>"types": "./es/index.d.ts"
TODOs
types.d.ts
comments!!!!