with a Dropdown
you can choose the color to a limited extent with button_type
:
from bokeh.io import show
from bokeh.models import CustomJS, Dropdown
menu = [("Item 1", "item_1"), ("Item 2", "item_2"), None, ("Item 3", "item_3")]
dropdown = Dropdown(label="Dropdown button", button_type="warning", menu=menu)
dropdown.js_on_event("menu_item_click", CustomJS(code="console.log('dropdown: ' + this.item, this.toString())"))
show(dropdown)
but no such kwarg exists for Select
:
from bokeh.io import show
from bokeh.models import CustomJS, Select
select = Select(title="Option:", value="foo", options=["foo", "bar", "baz", "quux"])
select.js_on_change("value", CustomJS(code="""
console.log('select: value=' + this.value, this.toString())
"""))
show(select)
i’ve tried to achieve something similar for Select
using Styles
, but none of the color fields there control the box itself, just the text above or the background.
with bokeh v2 i could set the css_styles
field of Select
to ['changed']
with a static/css/styles.css like this:
.changed .bk-input {
background-color: #FFA500 !important;
}
but that no longer works in v3.
there’s got to be a way to do this, right? how?? thanks.