From d8962dbc086fcdc3711bdd73273f05df6b4dc855 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Tue, 22 Oct 2024 19:00:15 -0700 Subject: [PATCH] fix pyi --- reflex/components/core/upload.py | 4 ++-- reflex/components/core/upload.pyi | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/reflex/components/core/upload.py b/reflex/components/core/upload.py index 278d9e0d5..a95bede10 100644 --- a/reflex/components/core/upload.py +++ b/reflex/components/core/upload.py @@ -224,7 +224,7 @@ class Upload(MemoizationLeaf): on_drop: EventHandler[_on_drop_spec] @classmethod - def create(cls, *children, multiple=True, **props) -> Component: + def create(cls, *children, **props) -> Component: """Create an upload component. Args: @@ -238,7 +238,7 @@ class Upload(MemoizationLeaf): # Mark the Upload component as used in the app. cls.is_used = True - props["multiple"] = multiple + props["multiple"].set_default(True) # Apply the default classname given_class_name = props.pop("class_name", []) diff --git a/reflex/components/core/upload.pyi b/reflex/components/core/upload.pyi index 5bbae892f..dfe0b7e5e 100644 --- a/reflex/components/core/upload.pyi +++ b/reflex/components/core/upload.pyi @@ -6,7 +6,11 @@ from pathlib import Path from typing import Any, ClassVar, Dict, List, Optional, Union, overload -from reflex.components.component import Component, ComponentNamespace, MemoizationLeaf +from reflex.components.component import ( + Component, + ComponentNamespace, + MemoizationLeaf, +) from reflex.constants import Dirs from reflex.event import ( CallableEventSpec, @@ -133,6 +137,7 @@ class Upload(MemoizationLeaf): Args: *children: The children of the component. + multiple: Whether to allow multiple files to be uploaded. accept: The list of accepted file types. This should be a dictionary of MIME types as keys and array of file formats as values. supported MIME types: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types disabled: Whether the dropzone is disabled. max_files: The maximum number of files that can be uploaded.