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

DiscreteSlider doesn't update properly when watching #1906

Closed
Adam-D-Lewis opened this issue Jan 13, 2021 · 0 comments
Closed

DiscreteSlider doesn't update properly when watching #1906

Adam-D-Lewis opened this issue Jan 13, 2021 · 0 comments
Milestone

Comments

@Adam-D-Lewis
Copy link

Adam-D-Lewis commented Jan 13, 2021

ALL software version info

panel 0.10.2 and see screenshot below for jupyter versions

Description of expected behavior and the observed behavior

I would expect the label above the discrete slider to update when the value is changed in the code (discrete_slider = 2), but instead it remains 32. The markdown updates correctly.

Complete, minimal, self-contained example code that reproduces the issue

import panel as pn
pn.extension()

discrete_slider = pn.widgets.DiscreteSlider(name='Discrete Slider', options=[2, 4, 8, 16, 32, 64, 128], value=32)
slider_val_markdown = pn.pane.Markdown(str(discrete_slider.value))

layout = pn.Column(discrete_slider, slider_val_markdown)

def update(event):
    layout.__setitem__(1, str(discrete_slider.value))

discrete_slider.param.watch(update, 'value')

discrete_slider.value = 2

layout

Screenshots or screencasts of the bug in action

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants