Re-enable onFocusOnly option for interaction defaults

This commit is contained in:
Andreas Hocevar
2020-06-03 12:29:37 +02:00
parent 346e9fadff
commit 2cac6c4f39
6 changed files with 28 additions and 42 deletions
+12
View File
@@ -59,6 +59,18 @@ export const focus = function (event) {
return event.target.getTargetElement().contains(document.activeElement);
};
/**
* Return `true` if the map has the focus or no 'tabindex' attribute set.
*
* @param {import("../MapBrowserEvent.js").default} event Map browser event.
* @return {boolean} The map container has the focus or no 'tabindex' attribute.
*/
export const focusWithTabindex = function (event) {
return event.map.getTargetElement().hasAttribute('tabindex')
? focus(event)
: true;
};
/**
* Return always true.
*