Re-enable onFocusOnly option for interaction defaults
This commit is contained in:
@@ -6,7 +6,7 @@ import PointerInteraction, {
|
||||
} from './Pointer.js';
|
||||
import {FALSE} from '../functions.js';
|
||||
import {easeOut} from '../easing.js';
|
||||
import {focus, noModifierKeys, primaryAction} from '../events/condition.js';
|
||||
import {noModifierKeys, primaryAction} from '../events/condition.js';
|
||||
import {
|
||||
rotate as rotateCoordinate,
|
||||
scale as scaleCoordinate,
|
||||
@@ -72,19 +72,6 @@ class DragPan extends PointerInteraction {
|
||||
this.noKinetic_ = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {import("../MapBrowserEvent").default} mapBrowserEvent Event.
|
||||
* @return {boolean} Condition passes.
|
||||
*/
|
||||
conditionInternal_(mapBrowserEvent) {
|
||||
let pass = true;
|
||||
if (mapBrowserEvent.map.getTargetElement().hasAttribute('tabindex')) {
|
||||
pass = focus(mapBrowserEvent);
|
||||
}
|
||||
return pass && this.condition_(mapBrowserEvent);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle pointer drag events.
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Event.
|
||||
@@ -167,10 +154,7 @@ class DragPan extends PointerInteraction {
|
||||
* @return {boolean} If the event was consumed.
|
||||
*/
|
||||
handleDownEvent(mapBrowserEvent) {
|
||||
if (
|
||||
this.targetPointers.length > 0 &&
|
||||
this.conditionInternal_(mapBrowserEvent)
|
||||
) {
|
||||
if (this.targetPointers.length > 0 && this.condition_(mapBrowserEvent)) {
|
||||
const map = mapBrowserEvent.map;
|
||||
const view = map.getView();
|
||||
this.lastCentroid = null;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import EventType from '../events/EventType.js';
|
||||
import Interaction, {zoomByDelta} from './Interaction.js';
|
||||
import {DEVICE_PIXEL_RATIO, FIREFOX} from '../has.js';
|
||||
import {always, focus} from '../events/condition.js';
|
||||
import {always} from '../events/condition.js';
|
||||
import {clamp} from '../math.js';
|
||||
|
||||
/**
|
||||
@@ -146,19 +146,6 @@ class MouseWheelZoom extends Interaction {
|
||||
this.deltaPerZoom_ = 300;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {import("../MapBrowserEvent").default} mapBrowserEvent Event.
|
||||
* @return {boolean} Condition passes.
|
||||
*/
|
||||
conditionInternal_(mapBrowserEvent) {
|
||||
let pass = true;
|
||||
if (mapBrowserEvent.map.getTargetElement().hasAttribute('tabindex')) {
|
||||
pass = focus(mapBrowserEvent);
|
||||
}
|
||||
return pass && this.condition_(mapBrowserEvent);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
@@ -179,7 +166,7 @@ class MouseWheelZoom extends Interaction {
|
||||
* @return {boolean} `false` to stop event propagation.
|
||||
*/
|
||||
handleEvent(mapBrowserEvent) {
|
||||
if (!this.conditionInternal_(mapBrowserEvent)) {
|
||||
if (!this.condition_(mapBrowserEvent)) {
|
||||
return true;
|
||||
}
|
||||
const type = mapBrowserEvent.type;
|
||||
|
||||
Reference in New Issue
Block a user