fix(2054): Crash on opening a play button menu
Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2372>
This commit is contained in:
parent
c7ac66d823
commit
ea0de43ad6
|
@ -105,7 +105,7 @@ const openMenu = () => {
|
|||
// little magic to ensure the menu is always visible in the viewport
|
||||
// By default, try to display it on the right if there is enough room
|
||||
const menu = dropdown.value.find('.menu')
|
||||
if (menu.classList.includes('visible')) return
|
||||
if (menu.hasClass('visible')) return
|
||||
const viewportOffset = menu.get(0)?.getBoundingClientRect() ?? { right: 0, left: 0 }
|
||||
const viewportWidth = document.documentElement.clientWidth
|
||||
const rightOverflow = viewportOffset.right - viewportWidth
|
||||
|
|
Loading…
Reference in New Issue