Black Lives Matter. Please consider donating to Black Girls Code today.

HTML/DBC Button Disable Not Working at Startup?

Hi all,

I’ve been working on an app and wanted to initially make a button disabled upon startup, and then allow it to be enabled later through a callback. However, it appears that setting disabled=True doesn’t seem to disable the button and when I mouse over it.

I’ve provded a reprex below:

import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc

external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']

app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
server = app.server
app.title = "Test"
app.config.suppress_callback_exceptions = True

app.layout = html.Div([
    html.Button("Test", id="test", disabled=True)
])

if __name__ == '__main__':
    app.run_server(debug=True)

I’ve also tried using dash bootstrap components and disabling that button upon startup, but it hasn’t worked, so perhaps it’s an issue on my end. Any help would be appreciated.