Skip to content

[Feature Request] Add allow_optional for Output #3462

@antonymilne

Description

@antonymilne

allow_optional is super useful for Input and State. Pretty please would it be possible to add it to Output too? 🙏

I would have liked to use this a few times before in callbacks where I use optional inputs, but now with devtool.hook it seems impossible to achieve some very useful functionality without having it.

Currently it seems like the components added by devtool.hook should be addressable in callbacks. There's no docs on this, but it's explicitly tested. Clearly this needs allow_optional since the component is only present when debug=True.

So at the moment it's possible to use components added in devtools as callback inputs/states but not as outputs. This feels like it's missing some very useful functionality that would be enabled if we could set allow_optional on Output.

How would an Output(allow_optional=True) work in practice? I guess the callback function would still return a value, but if the output doesn't exist it just doesn't raise an error for a non-existent Dash component.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogfeaturesomething new

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions