From 4e00f07c74f2398afcda1921601989af45ed9fa6 Mon Sep 17 00:00:00 2001 From: EdJoPaTo Date: Sat, 24 Feb 2024 00:04:39 +0100 Subject: [PATCH] fix(scrollbar): use current height rather than available height with item height = 1 its the same but with height != 1 its not --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 760c65d..58f4ff2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -253,7 +253,7 @@ where if let Some(scrollbar) = self.scrollbar { let mut scrollbar_state = ratatui::widgets::ScrollbarState::new(visible.len()) .position(start) - .viewport_content_length(available_height); + .viewport_content_length(height); let scrollbar_area = full_area.inner(&self.scrollbar_margin); scrollbar.render(scrollbar_area, buf, &mut scrollbar_state); }