fix upload default value
This commit is contained in:
parent
2786bd5bff
commit
669894500b
@ -238,7 +238,7 @@ class Upload(MemoizationLeaf):
|
|||||||
# Mark the Upload component as used in the app.
|
# Mark the Upload component as used in the app.
|
||||||
cls.is_used = True
|
cls.is_used = True
|
||||||
|
|
||||||
props["multiple"].set_default(True)
|
props.setdefault("multiple", True)
|
||||||
|
|
||||||
# Apply the default classname
|
# Apply the default classname
|
||||||
given_class_name = props.pop("class_name", [])
|
given_class_name = props.pop("class_name", [])
|
||||||
|
@ -642,21 +642,18 @@ def test_component_create_unallowed_types(children, test_component):
|
|||||||
"name": "Fragment",
|
"name": "Fragment",
|
||||||
"props": [],
|
"props": [],
|
||||||
"contents": "",
|
"contents": "",
|
||||||
"args": None,
|
|
||||||
"special_props": [],
|
"special_props": [],
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"name": "RadixThemesText",
|
"name": "RadixThemesText",
|
||||||
"props": ['as={"p"}'],
|
"props": ['as={"p"}'],
|
||||||
"contents": "",
|
"contents": "",
|
||||||
"args": None,
|
|
||||||
"special_props": [],
|
"special_props": [],
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"name": "",
|
"name": "",
|
||||||
"props": [],
|
"props": [],
|
||||||
"contents": '{"first_text"}',
|
"contents": '{"first_text"}',
|
||||||
"args": None,
|
|
||||||
"special_props": [],
|
"special_props": [],
|
||||||
"children": [],
|
"children": [],
|
||||||
"autofocus": False,
|
"autofocus": False,
|
||||||
@ -671,15 +668,12 @@ def test_component_create_unallowed_types(children, test_component):
|
|||||||
(
|
(
|
||||||
(rx.text("first_text"), rx.text("second_text")),
|
(rx.text("first_text"), rx.text("second_text")),
|
||||||
{
|
{
|
||||||
"args": None,
|
|
||||||
"autofocus": False,
|
"autofocus": False,
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"args": None,
|
|
||||||
"autofocus": False,
|
"autofocus": False,
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"args": None,
|
|
||||||
"autofocus": False,
|
"autofocus": False,
|
||||||
"children": [],
|
"children": [],
|
||||||
"contents": '{"first_text"}',
|
"contents": '{"first_text"}',
|
||||||
@ -694,11 +688,9 @@ def test_component_create_unallowed_types(children, test_component):
|
|||||||
"special_props": [],
|
"special_props": [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"args": None,
|
|
||||||
"autofocus": False,
|
"autofocus": False,
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"args": None,
|
|
||||||
"autofocus": False,
|
"autofocus": False,
|
||||||
"children": [],
|
"children": [],
|
||||||
"contents": '{"second_text"}',
|
"contents": '{"second_text"}',
|
||||||
@ -722,15 +714,12 @@ def test_component_create_unallowed_types(children, test_component):
|
|||||||
(
|
(
|
||||||
(rx.text("first_text"), rx.box((rx.text("second_text"),))),
|
(rx.text("first_text"), rx.box((rx.text("second_text"),))),
|
||||||
{
|
{
|
||||||
"args": None,
|
|
||||||
"autofocus": False,
|
"autofocus": False,
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"args": None,
|
|
||||||
"autofocus": False,
|
"autofocus": False,
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"args": None,
|
|
||||||
"autofocus": False,
|
"autofocus": False,
|
||||||
"children": [],
|
"children": [],
|
||||||
"contents": '{"first_text"}',
|
"contents": '{"first_text"}',
|
||||||
@ -745,19 +734,15 @@ def test_component_create_unallowed_types(children, test_component):
|
|||||||
"special_props": [],
|
"special_props": [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"args": None,
|
|
||||||
"autofocus": False,
|
"autofocus": False,
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"args": None,
|
|
||||||
"autofocus": False,
|
"autofocus": False,
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"args": None,
|
|
||||||
"autofocus": False,
|
"autofocus": False,
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"args": None,
|
|
||||||
"autofocus": False,
|
"autofocus": False,
|
||||||
"children": [],
|
"children": [],
|
||||||
"contents": '{"second_text"}',
|
"contents": '{"second_text"}',
|
||||||
@ -1117,10 +1102,10 @@ def test_component_with_only_valid_children(fixture, request):
|
|||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"component,rendered",
|
"component,rendered",
|
||||||
[
|
[
|
||||||
(rx.text("hi"), '<RadixThemesText as={"p"}>\n {"hi"}\n</RadixThemesText>'),
|
(rx.text("hi"), '<RadixThemesText as={"p"}>\n\n{"hi"}\n</RadixThemesText>'),
|
||||||
(
|
(
|
||||||
rx.box(rx.heading("test", size="3")),
|
rx.box(rx.heading("test", size="3")),
|
||||||
'<RadixThemesBox>\n <RadixThemesHeading size={"3"}>\n {"test"}\n</RadixThemesHeading>\n</RadixThemesBox>',
|
'<RadixThemesBox>\n\n<RadixThemesHeading size={"3"}>\n\n{"test"}\n</RadixThemesHeading>\n</RadixThemesBox>',
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user