Changing options of Select widget triggers Callback
See original GitHub issue@jasongrout we should have a way to change the options of a Select widget without triggering the callback function. Whenever the options are changed for the widget the value attribute is automatically set which forces the callback to be triggered. See code below;
from ipywidgets import Select
# callback
def cb(change):
print(change)
# widget
s_w = Select(value=None, options=['a','b'])
s_w.observe(cb, names='value')
# triggers no callback
s_w.value = None
# triggers callback
s_w.options = ['1', '2', '3']
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Trigger event when the select is changed - Stack Overflow
Triggered when the selected item has changed. Not every select event will fire a change event. select( event, ui ) Type: selectmenuselect.
Read more >How can I change the options of a Select field (bokeh serve)?
My project has two select fields. The first selection generates a list, which I want show in the second selection. The callback works...
Read more >Selectmenu Widget | jQuery UI API Documentation
change ( event, ui )Type: selectmenuchange. Triggered when the selected item has changed. Not every select event will fire a change event.
Read more >change - API Reference - Kendo UI DropDownList
Fired when the value of the widget is changed by the user. As of 2015 Q3 SP1 cascading widget will trigger change event...
Read more >Editing Resources and Callbacks in PhAB
The previously selected option is deselected. Apply your changes. The widget changes to reflect the new option. For a description of the standard...
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
@crahan my workaround has been to utilize the .unobserve method before updating the options.
Should fix #3284