Skip to content

Prevent button action from running on load? #884

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

You must be logged in to vote

Set the required option to true.

const reset = view(Inputs.button("Reset", {required: true}));

This sets the initial value to undefined which will prevent the generator from resolving until the button is clicked, such that any code block referencing reset likewise will not until click.

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