Skip to content

Commit

Permalink
Merge pull request jellyfin#1641 from dmitrylyzo/fix-event-source-2
Browse files Browse the repository at this point in the history
Fix event source for inputManager in case of multiple open dialogs
  • Loading branch information
dkanada committed Jul 25, 2020
2 parents 0afe858 + f292053 commit f5e93a1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/scripts/inputManager.js
Expand Up @@ -66,9 +66,12 @@ import appHost from 'apphost';
if (!sourceElement) {
sourceElement = document.activeElement || window;

const dlg = document.querySelector('.dialogContainer .dialog.opened');
const dialogs = document.querySelectorAll('.dialogContainer .dialog.opened');

if (dlg && (!sourceElement || !dlg.contains(sourceElement))) {
// Suppose the top open dialog is active
const dlg = dialogs.length ? dialogs[dialogs.length - 1] : null;

if (dlg && !dlg.contains(sourceElement)) {
sourceElement = dlg;
}
}
Expand Down

0 comments on commit f5e93a1

Please sign in to comment.