mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add timeouts to focus
This commit is contained in:
parent
667576e056
commit
458587475c
2 changed files with 9 additions and 5 deletions
|
@ -532,7 +532,9 @@ import layoutManager from 'layoutManager';
|
|||
|
||||
if (isEnabled()) {
|
||||
dom.addEventListener(window, 'focusin', function(e) {
|
||||
scrollToElement(e.target, useSmoothScroll());
|
||||
setTimeout(function() {
|
||||
scrollToElement(e.target, useSmoothScroll());
|
||||
}, 0);
|
||||
}, {capture: true});
|
||||
}
|
||||
|
||||
|
|
|
@ -17,10 +17,12 @@ import 'css!./emby-scroller';
|
|||
|
||||
function initCenterFocus(elem, scrollerInstance) {
|
||||
dom.addEventListener(elem, 'focus', function (e) {
|
||||
const focused = focusManager.focusableParent(e.target);
|
||||
if (focused) {
|
||||
scrollerInstance.toCenter(focused);
|
||||
}
|
||||
setTimeout(function() {
|
||||
const focused = focusManager.focusableParent(e.target);
|
||||
if (focused) {
|
||||
scrollerInstance.toCenter(focused);
|
||||
}
|
||||
}, 0);
|
||||
}, {
|
||||
capture: true,
|
||||
passive: true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue