From 9ba9d47519f874006f9066a4da3f7fc8c4987653 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Fri, 13 Dec 2024 00:07:41 +1300 Subject: [PATCH] Special case vertical scrolling for and elements --- packages/blitz-dom/src/document.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/blitz-dom/src/document.rs b/packages/blitz-dom/src/document.rs index 92a2751c..8858aacc 100644 --- a/packages/blitz-dom/src/document.rs +++ b/packages/blitz-dom/src/document.rs @@ -1087,12 +1087,18 @@ impl Document { return; }; + let is_html_or_body = node.raw_dom_data.downcast_element().is_some_and(|e| { + let tag = &e.name.local; + tag == "html" || tag == "body" + }); + let (can_x_scroll, can_y_scroll) = node .primary_styles() .map(|styles| { ( matches!(styles.clone_overflow_x(), Overflow::Scroll | Overflow::Auto), - matches!(styles.clone_overflow_y(), Overflow::Scroll | Overflow::Auto), + matches!(styles.clone_overflow_y(), Overflow::Scroll | Overflow::Auto) + || (styles.clone_overflow_y() == Overflow::Visible && is_html_or_body), ) }) .unwrap_or((false, false));