Skip to content

Allow disabling event listeners in dbc.Toast #948

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Ma-Schw opened this issue Mar 16, 2023 · 3 comments
Closed

Allow disabling event listeners in dbc.Toast #948

Ma-Schw opened this issue Mar 16, 2023 · 3 comments

Comments

@Ma-Schw
Copy link

Ma-Schw commented Mar 16, 2023

This issue focuses on accessibility of dbc.Toast.

If I create a dbc.Toast and check it for accessiblity issues with the tool "accessbility inspector" built into Firefox I get the following message on the header of dbc.Toast:
Clickable elements must be focusable and should have interactive semantics

In the DOM it looks like this:
Unbenannt

This issue used to occure in dash hmtl components for every html.Div. By default html.Divs are created including event listeneres.
To solve this problem the prop 'disable_n_clicks' was introduced into dash html components (link to PR)

I am hereby suggesting to add something like 'disable_n_clicks' to the header of dbc.Toast which allows to remove the event listener.

@tcbegley
Copy link
Collaborator

Hi @Ma-Schw

Thanks for raising this.

I can't seem to recreate this with the following example

import dash_bootstrap_components as dbc
from dash import Dash

app = Dash(external_stylesheets=[dbc.themes.BOOTSTRAP])

app.layout = dbc.Container(
    dbc.Toast("This is some text", header="Header"), className="p-5"
)

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

Would you be able to share a code snippet and some information about which versions of dash / dash-bootstrap-components you're using so I can look into this further?

@Ma-Schw
Copy link
Author

Ma-Schw commented Mar 20, 2023

Hi @tcbegley,

it turns that I caused the issue with my clientside callbacks. Sorry to have bothered you.

@tcbegley
Copy link
Collaborator

No problem, glad it's resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants