Skip to content

Commit adfc2cd

Browse files
committed
fix(table): viewport start doesn't account for Y offset
1 parent b00d086 commit adfc2cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

table/table.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ func (m *Model) UpdateViewport() {
268268
// Constant runtime, independent of number of rows in a table.
269269
// Limits the number of renderedRows to a maximum of 2*m.viewport.Height
270270
if m.cursor >= 0 {
271-
m.start = clamp(m.cursor-(m.viewport.Height-1), 0, m.cursor)
271+
m.start = clamp(m.cursor-m.viewport.YOffset-(m.viewport.Height-1), 0, m.cursor-m.viewport.YOffset)
272272
} else {
273273
m.start = 0
274274
}

0 commit comments

Comments
 (0)