Add timeouts to focus
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user