Scroll to focused item on tab rescan, fixes #1281
This commit is contained in:
parent
eaa756182a
commit
5edeea69f9
2 changed files with 21 additions and 2 deletions
|
|
@ -1664,6 +1664,7 @@ pub enum Message {
|
|||
Resize(Rectangle),
|
||||
Scroll(Viewport),
|
||||
ScrollTab(f32),
|
||||
ScrollToFocused,
|
||||
SearchContext(Location, SearchContextWrapper),
|
||||
SearchReady(bool),
|
||||
SelectAll,
|
||||
|
|
@ -3880,6 +3881,13 @@ impl Tab {
|
|||
.into(),
|
||||
));
|
||||
}
|
||||
Message::ScrollToFocused => {
|
||||
if let Some(offset) = self.select_focus_scroll() {
|
||||
commands.push(Command::Iced(
|
||||
scrollable::scroll_to(self.scrollable_id.clone(), offset).into(),
|
||||
));
|
||||
}
|
||||
}
|
||||
Message::SearchContext(location, context) => {
|
||||
if location == self.location {
|
||||
self.search_context = context.0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue