mirror of
https://github.com/ratatui/ratatui.git
synced 2025-09-28 13:31:14 +00:00
feat(widget): add offset()
to TableState
(#10)
Co-authored-by: Aaron Rennow <arennow@outlook.com>
This commit is contained in:
parent
7e31035114
commit
9b7a6ed85d
@ -352,6 +352,13 @@ impl TableState {
|
||||
self.offset = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns a copy of the receiver's scroll offset.
|
||||
///
|
||||
/// This is useful, for example, if you need to "synchronize" the scrolling of a `Table` and a `Paragraph`.
|
||||
pub fn offset(&self) -> usize {
|
||||
self.offset
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> StatefulWidget for Table<'a> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user