Skip to content

Can "Input" values be updated from secondary inputs? #883

Answered by mbostock
gouldingken asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, but you need to declare the input as well as its (reactive) value:

const populationInput = Inputs.range([0, 10000], {step: 10});
const population = view(populationInput);

Then you can do something like:

populationInput.value = 250;
populationInput.dispatchEvent(new Event("input", {bubbles: true}));

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gouldingken
Comment options

Answer selected by gouldingken
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants