mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Fix conflict with other scrollers
This commit is contained in:
parent
65373c8ae5
commit
4fb3a46fea
3 changed files with 90 additions and 37 deletions
|
@ -103,6 +103,8 @@ function centerOnFocusVertical(e) {
|
|||
|
||||
export const centerFocus = {
|
||||
on: function (element, horizontal) {
|
||||
element.setAttribute(`data-scroll-mode-${horizontal ? 'x' : 'y'}`, 'custom');
|
||||
|
||||
if (horizontal) {
|
||||
dom.addEventListener(element, 'focus', centerOnFocusHorizontal, {
|
||||
capture: true,
|
||||
|
@ -116,6 +118,8 @@ export const centerFocus = {
|
|||
}
|
||||
},
|
||||
off: function (element, horizontal) {
|
||||
element.removeAttribute(`data-scroll-mode-${horizontal ? 'x' : 'y'}`);
|
||||
|
||||
if (horizontal) {
|
||||
dom.removeEventListener(element, 'focus', centerOnFocusHorizontal, {
|
||||
capture: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue