Fix event source for inputManager

This commit is contained in:
Dmitry Lyzo 2020-03-14 22:29:58 +03:00
parent 305f050003
commit 4d6f187aee

View File

@ -58,7 +58,15 @@ define(['playbackManager', 'focusManager', 'appRouter', 'dom', 'apphost'], funct
sourceElement = focusManager.focusableParent(sourceElement);
}
sourceElement = sourceElement || document.querySelector('.dialogContainer .dialog.opened') || document.activeElement || window;
if (!sourceElement) {
sourceElement = document.activeElement || window;
var dlg = document.querySelector('.dialogContainer .dialog.opened');
if (dlg && (!sourceElement || !dlg.contains(sourceElement))) {
sourceElement = dlg;
}
}
if (eventListenerCount) {
var customEvent = new CustomEvent("command", {