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")] #[cfg(feature = "experimental_scrollbar")]
if let Some(scrollbar) = self.scrollbar { if let Some(scrollbar) = self.scrollbar {
let mut scrollbar_state = ratatui::widgets::ScrollbarState::new(visible.len()) let mut scrollbar_state =
.position(start) ratatui::widgets::ScrollbarState::new(visible.len().saturating_sub(height))
.viewport_content_length(height); .position(start)
.viewport_content_length(height);
let scrollbar_area = Rect { let scrollbar_area = Rect {
y: full_area.y.saturating_add(self.scrollbar_margin.0), y: full_area.y.saturating_add(self.scrollbar_margin.0),
height: full_area height: full_area