Button widgets, when disabled, still invoke their callback function when clicked. I had expected that setting Button.disabled to True would prevent the function of the button, as well as changing the appearance. Using the example code below, the message ‘Start button was clicked’ can be seen in the browser console when the (disabled) button is clicked.
from bokeh.models import Button, CustomJS
from bokeh.plotting import show
callback = CustomJS(code="""
var button_disabled = button.get(‘disabled’)
console.log(‘Start Button was pressed.’)
“”")
Is this intended behaviour? I understand that, of course, I could test the value of Button.disabled in my callback function, but I would expect the callback to simply not be invoked if the Button is disabled.
Button widgets, when disabled, still invoke their callback function when clicked. I had expected that setting Button.disabled to True would prevent the function of the button, as well as changing the appearance. Using the example code below, the message 'Start button was clicked' can be seen in the browser console when the (disabled) button is clicked.
from bokeh.models import Button, CustomJS
from bokeh.plotting import show
callback = CustomJS(code="""
var button_disabled = button.get('disabled')
console.log('Start Button was pressed.')
""")
Is this intended behaviour? I understand that, of course, I could test the value of Button.disabled in my callback function, but I would expect the callback to simply not be invoked if the Button is disabled.