-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
It looks like Widget.scroll_end() is off by one line. Here's an app to reproduce:
from textual.app import App, ComposeResult
from textual.widgets import DataTable, Footer
class Test(App):
BINDINGS = [("a", "add_row", "Add a row")]
DEFAULT_CSS = """
DataTable {
height: 5;
}
"""
def compose(self) -> ComposeResult:
rows = (
("1", "one"),
("2", "two"),
("3", "three"),
("4", "four"),
("5", "five"),
)
self.table = DataTable()
self.table.add_columns("#", "number")
self.table.add_rows(rows)
yield self.table
yield Footer()
def action_add_row(self) -> None:
self.table.add_row("6", "six")
self.table.scroll_end()
Test().run()After adding the sixth row, the DataTable scrolls to the fifth row.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working