diff --git a/solara/components/input_file.py b/solara/components/input_file.py index 60c4ce0ef..7eab4c8b5 100644 --- a/solara/components/input_file.py +++ b/solara/components/input_file.py @@ -16,7 +16,7 @@ def InputFile( label: str = "", on_total_progress: Optional[Callable[[float], None]] = None, - on_file: Union[None, Callable[[Optional[FileInfo]], None], Callable[[List[FileInfo]], None]] = None, + on_file: Union[None, Callable[[Union[None, FileInfo, List[FileInfo]]], None], None] = None, accept: str = "", multiple: bool = False, lazy: bool = True, @@ -79,7 +79,8 @@ def handle_file() -> None: return if not wired_files: if multiple: - on_file([]) + empty: List[FileInfo] = [] + on_file(empty) else: on_file(None) return