Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collapsive header does not accept a singular dash component as children argument #229

Open
mhwaage opened this issue Aug 4, 2022 · 0 comments

Comments

@mhwaage
Copy link

mhwaage commented Aug 4, 2022

From the docstring of CollapsiveHeader:

"""Creates a collapsible box with a large header label.

    Keyword arguments:

    - children (a list of or a singular dash component, string or number; required):
        The children of this component.
...
"""

However, if we pass anything other than a list as children argument, we are presented with the error:

***\site-packages\webviz_core_components\wrapped_components\collapsive_header.py", line 27, in __init__
    self.children = [
TypeError: can only concatenate list (not "Div") to list

which is caused by not inspecting the children argument before assigning it:

    def __init__(
        self, children: Any, open_details: bool = True, label: str = "", **kwargs: Any
    ) -> None:
        super().__init__(**kwargs)
        self.open = open_details
        self.children = [
            html.Summary(children=label, className="webviz-header")
        ] + children
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog 📝
Development

No branches or pull requests

1 participant