When pattern matching callbacks are used with 2 or more key-value pairs and the ALL keyword, Dash passes the list of Inputs to the callback function in the order in which they are created, instead of listing all of the elements of the first group, then the second group, etc. (see full examples at the end of the issue)
For example, if we create something with ids like:
Something like a sort_by argument for Input/Output/State that allows developers to specify the id dict key they want to use to sort the Inputs/States when using ALL.
When pattern matching callbacks are used with 2 or more key-value pairs and the ALL keyword, Dash passes the list of Inputs to the callback function in the order in which they are created, instead of listing all of the elements of the first group, then the second group, etc. (see full examples at the end of the issue)
For example, if we create something with ids like:
and we use
ALL
for bothcard_idx
andi
in the callback decorator (to get their values/children/whatever), we get a list, that summarised looks like:which is easy enough to work with. However, if buttons are added to the first card (or any except the last), then the order will be:
The expected output would be:
Describe the solution you'd like
Something like a
sort_by
argument for Input/Output/State that allows developers to specify the id dict key they want to use to sort the Inputs/States when using ALL.It could also be a list, like:
Sample apps
To replicate current behaviour:
Workaround (it only works if the broader/higher-level category has a pre-defined number of items)
Workaround variation with flexible callback signatures:
Additional context