How to update the "disabled" property in a custom widget?

I’ve create a custom widget and I’m trying to set its “disabled” property in a callback function:

ms = CustomMultiSelect(value=["a"], options=["a", "b"])


def callback(attr, old, new):
    ms.disabled = True


ms.on_change('value', callback)

curdoc().add_root(ms)

When the callback is invoked I get the following error in the console:
image

Seems like it happens only when trying to set the “disabled” property. Other properties don’t cause this error.

Best guess: you would need to implement the abstract controls method on your custom widget view to return all fo the HTML elements that need to have their disabled property updated. See:

If that’s not it, then you would need to provide actual code to investigate in order to speculate further.

Also, I should remind that it is always advised to include relevant version information in all questions.

Thanks @Bryan!
It didn’t work for me (maybe I did it wrong since I’m not so familiar with BokehJS).

I ended up creating a new enabled property for the widget so I’ll use it instead. I figured it will be the easiest/fastest sufficient solution.

Also, I should remind that it is always advised to include relevant version information in all questions.

Right, sorry for that.