Skip to content

Inputs and Plots are run even when condition is false #1946

Answered by Fil
dkrasne asked this question in Q&A
Discussion options

You must be logged in to vote

Only variables created at the top-level of a code block are visible outside of it. You could maybe replace your second block with:

const testInput = testTF === true ? html`<input type=range step=1 min=1 max=15>` : null;
const n = testTF === true ? view(testInput) : null;

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
5 replies
@dkrasne
Comment options

@dkrasne
Comment options

@Fil
Comment options

Fil Mar 15, 2025
Collaborator

@dkrasne
Comment options

@Fil
Comment options

Fil Mar 15, 2025
Collaborator

Answer selected by dkrasne
Comment options

You must be logged in to vote
2 replies
@Fil
Comment options

Fil Mar 15, 2025
Collaborator

@dkrasne
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
bug Something isn’t working
2 participants
Converted from issue

This discussion was converted from issue #1945 on March 14, 2025 18:02.