Skip to content

Commit

Permalink
clear search_value on dir load (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
juliapaci authored Feb 29, 2024
1 parent 50d2c95 commit 4a4ee9c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/file_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub enum DialogState {
/// if ui.button("Select a file").clicked() {
/// self.file_dialog.select_file();
/// }
///
///
/// if let Some(path) = self.file_dialog.update(ctx).selected() {
/// println!("Selected file: {:?}", path);
/// }
Expand Down Expand Up @@ -1198,6 +1198,8 @@ impl FileDialog {
///
/// The function also sets the loaded directory as the selected item.
fn load_directory(&mut self, path: &Path) -> io::Result<()> {
self.search_value.clear();

let full_path = match fs::canonicalize(path) {
Ok(path) => path,
Err(err) => {
Expand Down

0 comments on commit 4a4ee9c

Please sign in to comment.