Updated MouseTracker's hasGestureHandlers and hasScrollHandler to be getters

This commit is contained in:
Jessica R. 2025-01-02 23:07:13 -07:00 committed by GitHub
parent 9527f15f52
commit 641e085259
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -386,10 +386,9 @@
/**
* Do we currently have any assigned gesture handlers.
* @function
* @returns {Boolean} Do we currently have any assigned gesture handlers.
*/
hasGestureHandlers: function () {
get hasGestureHandlers() {
return !!(this.pressHandler ||
this.nonPrimaryPressHandler ||
this.releaseHandler ||
@ -403,10 +402,9 @@
/**
* Do we currently have a scroll handler.
* @function
* @returns {Boolean} Do we currently have a scroll handler.
*/
hasScrollHandler: function () {
get hasScrollHandler() {
return !!this.scrollHandler;
},
@ -2855,7 +2853,7 @@
eventInfo.isStoppable = true;
eventInfo.isCancelable = true;
eventInfo.preventDefault = false;
eventInfo.preventGesture = !tracker.hasGestureHandlers();
eventInfo.preventGesture = !tracker.hasGestureHandlers;
eventInfo.stopPropagation = false;
break;
case 'pointerover':
@ -2873,22 +2871,22 @@
case 'pointerdown':
eventInfo.isStoppable = true;
eventInfo.isCancelable = true;
eventInfo.preventDefault = false; // updatePointerDown() may set true (tracker.hasGestureHandlers())
eventInfo.preventGesture = !tracker.hasGestureHandlers();
eventInfo.preventDefault = false; // updatePointerDown() may set true (tracker.hasGestureHandlers)
eventInfo.preventGesture = !tracker.hasGestureHandlers;
eventInfo.stopPropagation = false;
break;
case 'pointerup':
eventInfo.isStoppable = true;
eventInfo.isCancelable = true;
eventInfo.preventDefault = false;
eventInfo.preventGesture = !tracker.hasGestureHandlers();
eventInfo.preventGesture = !tracker.hasGestureHandlers;
eventInfo.stopPropagation = false;
break;
case 'wheel':
eventInfo.isStoppable = true;
eventInfo.isCancelable = true;
eventInfo.preventDefault = false; // handleWheelEvent() may set true
eventInfo.preventGesture = !tracker.hasScrollHandler();
eventInfo.preventGesture = !tracker.hasScrollHandler;
eventInfo.stopPropagation = false;
break;
case 'gotpointercapture':