Skip to content

Commit

Permalink
feat(touch events): use passive mode in more cases #12822 (#14474)
Browse files Browse the repository at this point in the history
* feat(touch events): use passive mode in more cases #12822

* Update TouchPan.js

* Update TouchSwipe.js

Co-authored-by: Razvan Stoenescu <razvan.stoenescu@gmail.com>
  • Loading branch information
pdanpdan and rstoenescu authored Oct 1, 2022
1 parent 5221ac1 commit cebd845
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ui/src/components/btn/QBtn.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default Vue.extend({
}

if (this.$q.platform.has.touch === true) {
on.touchstart = this.__onTouchstart
on[ `${on.touchstart === void 0 ? '&' : ''}touchstart` ] = this.__onTouchstart
}

return on
Expand Down
2 changes: 1 addition & 1 deletion ui/src/directives/TouchHold.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export default {

client.has.touch === true && addEvt(ctx, 'main', [
[ el, 'touchstart', 'touchStart', `passive${modifiers.capture === true ? 'Capture' : ''}` ],
[ el, 'touchend', 'noop', 'notPassiveCapture' ]
[ el, 'touchend', 'noop', 'passiveCapture' ]
])
},

Expand Down
2 changes: 1 addition & 1 deletion ui/src/directives/TouchPan.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ export default {

client.has.touch === true && addEvt(ctx, 'main', [
[ el, 'touchstart', 'touchStart', `passive${modifiers.capture === true ? 'Capture' : ''}` ],
[ el, 'touchmove', 'noop', 'notPassiveCapture' ]
[ el, 'touchmove', 'noop', 'notPassiveCapture' ] // cannot be passive (ex: iOS scroll)
])
},

Expand Down
2 changes: 1 addition & 1 deletion ui/src/directives/TouchRepeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export default {

client.has.touch === true && addEvt(ctx, 'main', [
[ el, 'touchstart', 'touchStart', `passive${modifiers.capture === true ? 'Capture' : ''}` ],
[ el, 'touchend', 'noop', 'notPassiveCapture' ]
[ el, 'touchend', 'noop', 'passiveCapture' ]
])

keyboard.length > 0 && addEvt(ctx, 'main', [
Expand Down
2 changes: 1 addition & 1 deletion ui/src/directives/TouchSwipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export default {

client.has.touch === true && addEvt(ctx, 'main', [
[ el, 'touchstart', 'touchStart', `passive${modifiers.capture === true ? 'Capture' : ''}` ],
[ el, 'touchmove', 'noop', 'notPassiveCapture' ]
[ el, 'touchmove', 'noop', 'notPassiveCapture' ] // cannot be passive (ex: iOS scroll)
])
},

Expand Down

0 comments on commit cebd845

Please sign in to comment.