Skip to content

dbc.Button incompatible with ConfirmDialogProvider #1110

@tcbegley

Description

@tcbegley

Hi, I encountered the exact same issue with the following versions:

  • dash==3.0.1
  • dash-bootstrap-components==2.0.0

When running this code as taken from the dash-docs (https://dash.plotly.com/dash-core-components/confirmdialogprovider), but with a dbc.Button:

from dash import Dash, Input, Output, html, dcc, callback
import dash_bootstrap_components as dbc

app = Dash()

app.layout = html.Div([
    dcc.ConfirmDialogProvider(
        children=dbc.Button('Click Me', ),
        id='danger-danger-provider',
        message='Danger danger! Are you sure you want to continue?'
    ),
    html.Div(id='output-provider')
])


@callback(Output('output-provider', 'children'),
          Input('danger-danger-provider', 'submit_n_clicks'))
def update_output(submit_n_clicks):
    if not submit_n_clicks:
        return ''
    return """
        It was dangerous but we did it!
        Submitted {} times
    """.format(submit_n_clicks)


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

The ConfirmDialog does not show up. When using a html.Button or a dmc.Button, it is working as intended.
Please reopen if I did not mix something up here :-)

Originally posted by @manu418 in #762

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions