Skip to content

Commit

Permalink
file-dialog: apply the default filter
Browse files Browse the repository at this point in the history
The commit fixes an issue where the `file-dialog` filter was not
respected when we display the dialog initially. Previously a change
event in the filter meant that the dialog was properly filtered.

Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>
  • Loading branch information
vince-fugnitto committed Sep 20, 2021
1 parent 0f7dec1 commit aed9876
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/filesystem/src/browser/file-dialog/file-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ export abstract class FileDialog<T> extends AbstractDialog<T> {

if (this.props.filters) {
this.treeFiltersRenderer = this.treeFiltersFactory({ suppliedFilters: this.props.filters, fileDialogTree: this.widget.model.tree });
const filters = Object.keys(this.props.filters);
if (filters.length) {
this.widget.model.tree.setFilter(this.props.filters[filters[0]]);
}
}
}

Expand Down

0 comments on commit aed9876

Please sign in to comment.