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

[BUG] CheckboxGroup minimal example in the documentation (Widgets and DOM elements 3.0.3) does not work properly #12710

Closed
santelelle opened this issue Jan 4, 2023 · 3 comments · Fixed by #12840

Comments

@santelelle
Copy link

Software versions

Python version : 3.9.5 (default, Jun 4 2021, 12:28:51)
IPython version : (not installed)
Tornado version : 6.1
Bokeh version : 3.0.3
BokehJS static path : /home/lele/.conda/envs/py3.9-torch1.9-opencv/lib/python3.9/site-packages/bokeh/server/static
node.js version : v16.19.0
npm version : 8.19.2
Operating system : Linux-6.1.1-arch1-1-x86_64-with-glibc2.36

Browser name and version

Chrome Version 108.0.5359.124 (Official Build) (64-bit)

Jupyter notebook / Jupyter Lab version

No response

Expected behavior

Nothing is written in the browser console when changing the status of the CheckboxGroup (The callback seems to be not triggered).

Other example codes (i.e. the Switch) properly print in the browser console.

Observed behavior

Nothing happens.

Example code

from bokeh.io import show
from bokeh.models import CheckboxGroup, CustomJS

LABELS = ["Option 1", "Option 2", "Option 3"]

checkbox_group = CheckboxGroup(labels=LABELS, active=[0, 1])
checkbox_group.js_on_event('button_click', CustomJS(code="""
    console.log('checkbox_group: active=' + this.origin.active, this.toString())
"""))

show(checkbox_group)

Stack traceback or browser console output

No response

Screenshots

No response

@bryevdv
Copy link
Member

bryevdv commented Jan 4, 2023

This code works:

checkbox_group.js_on_change('active', CustomJS(code="""
    console.log('checkbox_group: active=' + this.active, this.toString())
"""))

and as far as I know is what the code should actually be in the docs. @mattpap can you comment?

@bryevdv
Copy link
Member

bryevdv commented Jan 4, 2023

The RadioGroup example is broken in exactly the same way

https://docs.bokeh.org/en/latest/docs/user_guide/interaction/widgets.html#radiogroup

@bryevdv bryevdv added type: bug and removed TRIAGE labels Jan 4, 2023
@bryevdv bryevdv added this to the 3.1 milestone Jan 4, 2023
@bryevdv
Copy link
Member

bryevdv commented Jan 4, 2023

I've tentatively triaged this as a docs bug, though perhaps some version of a button event is also supposed to function.

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

Successfully merging a pull request may close this issue.

3 participants