Preserve contacts popover editor contents when switching to search mode

This commit is contained in:
Julia 2023-03-09 22:05:32 -05:00
parent e7af3f223a
commit 01e3173ed0
4 changed files with 41 additions and 10 deletions

View file

@ -205,6 +205,11 @@ impl<D: PickerDelegate> Picker<D> {
self.query_editor.read(cx).text(cx)
}
pub fn set_query(&self, query: impl Into<Arc<str>>, cx: &mut ViewContext<Self>) {
self.query_editor
.update(cx, |editor, cx| editor.set_text(query, cx));
}
fn on_query_editor_event(
&mut self,
_: ViewHandle<Editor>,