Skip to content

Commit

Permalink
fix(table): viewport start doesn't account for Y offset
Browse files Browse the repository at this point in the history
  • Loading branch information
System-Glitch committed Feb 13, 2025
1 parent b00d086 commit adfc2cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion table/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func (m *Model) UpdateViewport() {
// Constant runtime, independent of number of rows in a table.
// Limits the number of renderedRows to a maximum of 2*m.viewport.Height
if m.cursor >= 0 {
m.start = clamp(m.cursor-(m.viewport.Height-1), 0, m.cursor)
m.start = clamp(m.cursor-m.viewport.YOffset-(m.viewport.Height-1), 0, m.cursor-m.viewport.YOffset)
} else {
m.start = 0
}
Expand Down

0 comments on commit adfc2cd

Please sign in to comment.