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

dmc.Collapse - required parameter in does not work #305

Closed
MichaelODeli opened this issue Sep 8, 2024 · 7 comments · Fixed by #311
Closed

dmc.Collapse - required parameter in does not work #305

MichaelODeli opened this issue Sep 8, 2024 · 7 comments · Fixed by #311
Assignees

Comments

@MichaelODeli
Copy link

When I try to use the undocumented Collapse component, I get the following error:

    dmc.Collapse(in=True, children=[dmc.Button()])
                 ^^
SyntaxError: invalid syntax

Same issue with Fieldset and NumberFormatter (undocumented props).


I also saw that the following components are missing: Tree, SemiCircleProgress, Dialog, ColorSwatch,

@AnnMarieW
Copy link
Collaborator

Hi @MichaelODeli
Thanks for reporting - I could replicate this issue with the in prop.

Are you interested in doing any pull requests either in the dmc-doc repo or here?

@MichaelODeli
Copy link
Author

@AnnMarieW Yes, I will try to add undocumented components to dmc-docs.

@MichaelODeli
Copy link
Author

MichaelODeli commented Sep 8, 2024

The same error with Fieldset component - unexpected argument (link)

TypeError: The `dash_mantine_components.Fieldset` component (version 0.14.4) received an unexpected keyword argument: `disabled`

But in dmc-docs with configurator.add_switch("disabled", False) param - it works fine

@AnnMarieW
Copy link
Collaborator

That's odd - but in the upstream docs, disabled is not a valid prop for Fieldset
https://mantine.dev/core/fieldset/?t=props

@AnnMarieW
Copy link
Collaborator

I think I see how to fix this. It would be helpful if you could make a draft PR for the Fieldset component, then when the fix is done, the docs will be ready to go. :-)

@MichaelODeli
Copy link
Author

@AnnMarieW snehilvj/dmc-docs#64

@alexcjohnson
Copy link
Collaborator

FWIW there is a way to use props masked by Python keywords, or that in some other way are invalid as kwargs:

dmc.Collapse(children=[dmc.Button()], **{"in": True})

Which is what you have to do for example to use the data-* and aria-* wildcard props in dash.html because of the hyphens.

But I agree, this pattern is tricky, ugly, and non-Pythonic so better to change it where we can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants