Skip to content

allow optional callback inputs #3067

Open

Description

Problem

In a number of cases, I have callbacks that have Inputs/States that are only conditionally present on the page, which causes console errors (ReferenceError), and prevents the callback to run.

Examples where this could happen:

  • A global store at the app level being updated from inputs on a given page -> this will raise the ReferenceError log when I am on a different page
  • Several objects that are conditionally present on a page and update another element

Expected solution

I would like to be able to mark inputs as optional, in which case they would default to None in the callback when the element is not present.

Current workaround

In some cases I can use a pattern matching callback with ALL to make the input optional (no input will give an empty list), however this feels hackish and does not always work with existing pattern-matching ids.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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