fix(scrollbar): workaround overscroll

This commit is contained in:
EdJoPaTo
2024-02-24 03:07:23 +01:00
parent ce3b2b530e
commit 98b53e448f
+4 -3
View File
@@ -254,9 +254,10 @@ where
#[cfg(feature = "experimental_scrollbar")]
if let Some(scrollbar) = self.scrollbar {
let mut scrollbar_state = ratatui::widgets::ScrollbarState::new(visible.len())
.position(start)
.viewport_content_length(height);
let mut scrollbar_state =
ratatui::widgets::ScrollbarState::new(visible.len().saturating_sub(height))
.position(start)
.viewport_content_length(height);
let scrollbar_area = Rect {
y: full_area.y.saturating_add(self.scrollbar_margin.0),
height: full_area