diff --git a/sepal_ui/sepalwidgets/inputs.py b/sepal_ui/sepalwidgets/inputs.py index 2c652a76..5d45bdc0 100644 --- a/sepal_ui/sepalwidgets/inputs.py +++ b/sepal_ui/sepalwidgets/inputs.py @@ -403,14 +403,14 @@ def _get_items(self) -> List[v.ListItem]: list_dir = [el for el in folder.glob("*") if not el.name.startswith(".")] if self.extensions: - valid_list_dir = [] # New list to store valid entries + valid_list_dir = [] for el in list_dir: try: if el.is_dir() or el.suffix in self.extensions: valid_list_dir.append(el) except Exception: continue - list_dir = valid_list_dir # Replace the original list with the filtered one + list_dir = valid_list_dir if folder in self.cache_dirs: if self.cache_dirs[folder]["files"] == list_dir: