fix(scrollbar): use current height rather than available height

with item height = 1 its the same but with height != 1 its not
This commit is contained in:
EdJoPaTo
2024-02-24 00:04:39 +01:00
parent 85bfecc568
commit 4e00f07c74
+1 -1
View File
@@ -253,7 +253,7 @@ where
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 = ratatui::widgets::ScrollbarState::new(visible.len())
.position(start) .position(start)
.viewport_content_length(available_height); .viewport_content_length(height);
let scrollbar_area = full_area.inner(&self.scrollbar_margin); let scrollbar_area = full_area.inner(&self.scrollbar_margin);
scrollbar.render(scrollbar_area, buf, &mut scrollbar_state); scrollbar.render(scrollbar_area, buf, &mut scrollbar_state);
} }