Skip to content

Commit

Permalink
search box click fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
warycat committed Aug 21, 2021
1 parent 7dab830 commit 4ffb014
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 3 additions & 4 deletions wasm/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,9 @@ impl Client {
}

pub fn on_query_text(&self, query_text: String) -> Result<(), JsValue> {
self.searchbar
.as_ref()
.expect("searchbar")
.close_search_suggestions()?;
let searchbar = self.searchbar.as_ref().expect("searchbar");
searchbar.update_search_input(&query_text);
searchbar.close_search_suggestions()?;
self.send_json(MsgIn::QueryText(query_text))?;
Ok(())
}
Expand Down
4 changes: 4 additions & 0 deletions wasm/src/searchbar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ impl SearchBar {
self.search_suggestions.class_list().add_1("empty")
}

pub fn update_search_input(&self, text: &str) {
self.search_input.set_value(text);
}

pub fn update_search_suggestions(
&self,
search_suggestions: Vec<String>,
Expand Down

0 comments on commit 4ffb014

Please sign in to comment.