This commit is contained in:
Khaleel Al-Adhami 2024-10-22 19:00:15 -07:00
parent 42b8586ab9
commit d8962dbc08
2 changed files with 8 additions and 3 deletions

View File

@ -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", [])

View File

@ -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.