Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@bind doesn't update values within the same cell #391

Closed
aplavin opened this issue Sep 9, 2020 · 1 comment
Closed

@bind doesn't update values within the same cell #391

aplavin opened this issue Sep 9, 2020 · 1 comment
Labels
reactivity The Pluto programming paradigm

Comments

@aplavin
Copy link
Contributor

aplavin commented Sep 9, 2020

A cell containing both @bind and a reference to the binded value does not keep them in sync.
E.g. create this cell:

md"""
$(@bind x Slider(0:10))
x = $x
"""

and drag the slider around. It always shows "x = 0" on the second line.

@fonsp
Copy link
Owner

fonsp commented Sep 9, 2020

Hi @aplavin!
That's on purpose, if the cell would run again with your new value, then it would also create a new slider, which is set to its default value. So you wouldn't be able to move the slider.

@fonsp fonsp added the reactivity The Pluto programming paradigm label Sep 9, 2020
@fonsp fonsp closed this as completed Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reactivity The Pluto programming paradigm
Projects
None yet
Development

No branches or pull requests

2 participants