1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Fix event source for inputManager in case of multiple open dialogs

This commit is contained in:
Dmitry Lyzo 2020-07-25 00:29:43 +03:00
parent 0afe85810d
commit f292053b49

View file

@ -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;
}
}