Skip to content

[BUG] Cannot disable MultiSelect in 2.2.1 #10507

Description

@rstrutt

Issue originally raised on Discourse, here: https://discourse.bokeh.org/t/cannot-disable-multiselect-in-2-2-1/6374/3

ALL software version info (bokeh, python, notebook, OS, browser, any other relevant packages)

Bokeh 1.4.0 (works), Bokeh 2.2.0 (shows the issue)
Python 3.7.3
Chrome 78.0.3904.108 (Official Build) (64-bit)
Windows 7 Professional SP1

Description of expected behavior and the observed behavior

Setting the disabled property of a MultiSelect on the Python side throws a javascript error rather than disabling/enabling the control.

The functionality works as expected for Select widgets but not MultiSelect widgets (it works for both widget types in 1.4.0).

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

Minimal code example below, to be invoked with 'bokeh serve'.

Click on the button - it simply sets the disabled property of the MultiSelect. Observe the javascript error in the console and the widget not being disabled.

Un-comment the Select widget line (and comment the MultiSelect) to observe the expected behavior of the widget being disabled.

from bokeh.layouts import column
    from bokeh.models import Button, MultiSelect, Select
    from bokeh.plotting import curdoc

    # Get a reference to the document we will be creating
    doc = curdoc()

    # Create a Button and a MultiSelect box
    button = Button(label='Press Here')
    select = MultiSelect(options=[('A', 'B'), ('C', 'D')])  # <-- Throws JS error when disabled
    # select = Select(options=[('A', 'B'), ('C', 'D')])  # <-- Does not throw JS error when disabled

    # Add a python callback on the Button to disable the MultiSelect/Select.
    def button_handler():
        select.disabled = True

    button.on_click(button_handler)

    # Put them in a column
    col = column(button, select)

    # Put the column into the document
    doc.add_root(col)

Screenshots or screencasts of the bug in action

Screenshot of the javascript console after pressing the button;

image

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions