Fix mouse interactions with tabindex in external window

This commit is contained in:
Maximilian Krög
2021-10-14 23:51:50 +02:00
parent 86801d1151
commit d1560176ba

View File

@@ -83,7 +83,11 @@ export const altShiftKeysOnly = function (mapBrowserEvent) {
* @api
*/
export const focus = function (event) {
return event.target.getTargetElement().contains(document.activeElement);
const targetElement = event.map.getTargetElement();
return targetElement.contains(
/** @type {Document} */ (targetElement.getRootNode({composed: true}))
.activeElement
);
};
/**