Scroll to top when list have searched. (#64)
This commit is contained in:
parent
764e7486e7
commit
d60a1122d4
1 changed files with 6 additions and 1 deletions
|
|
@ -199,10 +199,15 @@ where
|
|||
|
||||
self._search_task = cx.spawn(|this, mut cx| async move {
|
||||
search.await;
|
||||
|
||||
let _ = this.update(&mut cx, |this, _| {
|
||||
this.vertical_scroll_handle.scroll_to_item(0);
|
||||
this.last_query = Some(text);
|
||||
});
|
||||
|
||||
// Always wait 100ms to avoid flicker
|
||||
Timer::after(Duration::from_millis(100)).await;
|
||||
let _ = this.update(&mut cx, |this, cx| {
|
||||
this.last_query = Some(text);
|
||||
this.set_loading(false, cx);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue