Bug:
So basically with the following code, when toggling the switch will:
- change the background of the selected value
- change the fond color of the list of options
*tested in safari 16.6
expected behaivor
- affect either the selected value or the list of options, not both
Any comments?
from dash import Dash, html, dcc, dash_table, callback, Input, Output
import dash_daq as daq
app = Dash(__name__)
#################################
# App details go in here
app.layout = html.Div(id = 'test', children = [
daq.ToggleSwitch(id='colors_scheme', value=False),
dcc.Dropdown([{
"label": html.Span("A"),
"value": "A",
},{
"label": html.Span("B"),
"value": "B",
},{
"label": html.Span("C"),
"value": "C",
}
],
id='language_sel',
clearable = False)
])
@callback(
Output('language_sel', 'style'),
Input('colors_scheme', 'value')
)
def change_color_scheme(color_value):
if color_value:
return {'color':'white','background-color':'gray'}
else:
return {'color': 'black', 'background-color':'white'}
if __name__ == '__main__':
app.run_server(debug=True)