tabindex without focux condition
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/interaction/MouseWheelZoom
|
||||
*/
|
||||
import {always} from '../events/condition.js';
|
||||
import {always, focus} from '../events/condition.js';
|
||||
import EventType from '../events/EventType.js';
|
||||
import {DEVICE_PIXEL_RATIO, FIREFOX} from '../has.js';
|
||||
import Interaction, {zoomByDelta} from './Interaction.js';
|
||||
@@ -134,6 +134,20 @@ class MouseWheelZoom extends Interaction {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @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
|
||||
*/
|
||||
@@ -149,7 +163,7 @@ class MouseWheelZoom extends Interaction {
|
||||
* @override
|
||||
*/
|
||||
handleEvent(mapBrowserEvent) {
|
||||
if (!this.condition_(mapBrowserEvent)) {
|
||||
if (!this.conditionInternal_(mapBrowserEvent)) {
|
||||
return true;
|
||||
}
|
||||
const type = mapBrowserEvent.type;
|
||||
|
||||
Reference in New Issue
Block a user