select first item in listviews initially
This commit is contained in:
@@ -42,7 +42,7 @@ impl SearchView {
|
||||
results: results,
|
||||
edit: searchfield,
|
||||
list: scrollable,
|
||||
edit_focused: false,
|
||||
edit_focused: true,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,14 +67,6 @@ impl SearchView {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn focus_search(&mut self) {
|
||||
self.edit
|
||||
.call_on(&Selector::Id("search_edit"), |v: &mut EditView| {
|
||||
v.set_content("");
|
||||
});
|
||||
self.edit_focused = true;
|
||||
}
|
||||
|
||||
fn pass_event_focused(&mut self, event: Event) -> EventResult {
|
||||
match self.edit_focused {
|
||||
true => self.edit.on_event(event),
|
||||
|
||||
Reference in New Issue
Block a user