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

allow optional callback inputs #3067

Open
RenaudLN opened this issue Nov 8, 2024 · 0 comments
Open

allow optional callback inputs #3067

RenaudLN opened this issue Nov 8, 2024 · 0 comments
Labels
feature something new P3 backlog

Comments

@RenaudLN
Copy link
Contributor

RenaudLN commented Nov 8, 2024

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.

@gvwilson gvwilson changed the title [Feature Request] Optional callback inputs allow optional callback inputs Nov 11, 2024
@gvwilson gvwilson added feature something new P3 backlog labels Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new P3 backlog
Projects
None yet
Development

No branches or pull requests

2 participants