Skip to content

Commit

Permalink
Merge pull request #67 from thebuilder/patch-1
Browse files Browse the repository at this point in the history
Add passive to touchstart event
  • Loading branch information
ten1seven authored Jul 12, 2017
2 parents 7f0d595 + 58f2e01 commit e010bd7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/what-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ module.exports = (() => {
// `pointermove`, `MSPointerMove`, `mousemove` and mouse wheel event binding
// can only demonstrate potential, but not actual, interaction
// and are treated separately
const options = supportsPassive ? { passive: true } : false

// pointer events (mouse, pen, touch)
if (window.PointerEvent) {
Expand All @@ -114,7 +115,7 @@ module.exports = (() => {

// touch events
if ('ontouchstart' in window) {
doc.addEventListener('touchstart', touchBuffer)
doc.addEventListener('touchstart', touchBuffer, options)
doc.addEventListener('touchend', touchBuffer)
}
}
Expand All @@ -123,7 +124,7 @@ module.exports = (() => {
doc.addEventListener(
detectWheel(),
setIntent,
supportsPassive ? { passive: true } : false
options
)

// keyboard events
Expand Down

0 comments on commit e010bd7

Please sign in to comment.