Yep, I think this is the key point. If you open up the developer console (F12), you’ll see that there’s a javascript error for every position in the slider except 5.
You’e essentially trying to tell Dash, this callback function takes 5 arguments, and they have these IDs, Dash goes off and goes to look for those IDs to get the values, but any time the slider is not at 5, there will be at least one of those elements missing from the DOM, so you’ve now got an undefined value/error.
I think you might be confusing your generated sliders with text inputs. dcc.Input is just a text input.
You definitely can generate a list of dependency Inputs based on some other value, the key thing is that you need to make sure they’re all in the DOM when you trigger the callback – as is the problem in your code.
If I were you, I would push as much of the generation of layout and Inputs to be upfront, evaluated when Dash loads. You know ahead of time how many sliders there will be for each model, so why not have a callback that targets the value of a dropdown, and inside the callback you test the value, and then go lookup a dictionary of precomputed layout fragments that have the sliders you need? That way, you know that you’ll have all sliders that are inputs for the relevant model loaded in the DOM. It’s still dynamic, you’re changing the layout based on the dropdown, but the layouts you’re choosing from have already been precomputed.
The other advantage of that is you’re less likely to run into runtime bugs in your layout generation code while a user is using it-- you’ll hit them as soon as the app is loaded.