Skip to content

Commit bd48658

Browse files
authored
fix(VMenu, VTooltip): apply scroll-strategy reposition for horizontal overflow (#21309)
fixes #20625
1 parent 80cb876 commit bd48658

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/vuetify/src/util/getScrollParent.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ export function hasScrollbar (el?: Element | null) {
2525
if (!el || el.nodeType !== Node.ELEMENT_NODE) return false
2626

2727
const style = window.getComputedStyle(el)
28-
return style.overflowY === 'scroll' || (style.overflowY === 'auto' && el.scrollHeight > el.clientHeight)
28+
const hasVerticalScrollbar = style.overflowY === 'scroll' || (style.overflowY === 'auto' && el.scrollHeight > el.clientHeight)
29+
const hasHorizontalScrollbar = style.overflowX === 'scroll' || (style.overflowX === 'auto' && el.scrollWidth > el.clientWidth)
30+
return hasVerticalScrollbar || hasHorizontalScrollbar
2931
}
3032

3133
function isPotentiallyScrollable (el?: Element | null) {

0 commit comments

Comments
 (0)