fix reflex-web test for select

This commit is contained in:
Elijah 2024-10-18 13:53:54 +00:00
parent 07dfb48d8e
commit 11a38adffa
2 changed files with 5 additions and 4 deletions

View File

@ -1,6 +1,6 @@
"""Interactive components provided by @radix-ui/themes.""" """Interactive components provided by @radix-ui/themes."""
from typing import List, Literal from typing import List, Literal, Union
import reflex as rx import reflex as rx
from reflex.components.component import Component, ComponentNamespace from reflex.components.component import Component, ComponentNamespace
@ -180,17 +180,16 @@ class HighLevelSelect(SelectRoot):
position: Var[Literal["item-aligned", "popper"]] position: Var[Literal["item-aligned", "popper"]]
@classmethod @classmethod
def create(cls, **props) -> Component: def create(cls, items: Union[List[str], Var[List[str]]], **props) -> Component:
"""Create a select component. """Create a select component.
Args: Args:
items: The items of the select.
**props: Additional properties to apply to the select component. **props: Additional properties to apply to the select component.
Returns: Returns:
The select component. The select component.
""" """
items = props.pop("items")
trigger_prop_list = [ trigger_prop_list = [
"placeholder", "placeholder",
"variant", "variant",

View File

@ -701,6 +701,7 @@ class HighLevelSelect(SelectRoot):
"""Create a select component. """Create a select component.
Args: Args:
items: The items of the select.
items: The items of the select. items: The items of the select.
placeholder: The placeholder of the select. placeholder: The placeholder of the select.
label: The label of the select. label: The label of the select.
@ -874,6 +875,7 @@ class Select(ComponentNamespace):
"""Create a select component. """Create a select component.
Args: Args:
items: The items of the select.
items: The items of the select. items: The items of the select.
placeholder: The placeholder of the select. placeholder: The placeholder of the select.
label: The label of the select. label: The label of the select.