Disabled Buttons still call callbacks when clicked
See original GitHub issueButton widgets, when disabled, still invoke their callback function when clicked. 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="""
console.log('Start Button was pressed.')
""")
button_one = Button(label="Start", disabled=True, callback=callback)
show(button_one)
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Tkinter(python) disabled buttons calls method - Stack Overflow
The DISABLED field of the button only controls the built-in callback for the button. If you make a separate "handmade" binding on your...
Read more >Can I disable a button while callback is running? - Param
Help much appreciated! Welcome to the community. Great question. Yes you can disable the buttons while they are executing the associated function.
Read more >[BUG] Unable to disable buttons in on_click callbacks #9404
I am trying to disable a button after making a search call and enable it back after the search call is successful. However,...
Read more >Disable buttons while running callback using new dash version
Hi, I am executing a time-intensive query inside of a callback when clicking a button. During this, I am showing a loading symbol....
Read more >The Disabled Attribute in React Buttons - Upmostly
Despite having the onClick attribute set, the first button doesn't log anything to the console when clicked. The disabled attribute prevents the onClick...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
IMO disabled widgets should be greyed, non-interactable, and (as a consequence) never fire callbacks. I’m not sure what “disabled” would mean otherwise.
This is actually a dupe of #1376