Skip to content
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

Adjust z-index of dash error menu #1553

Merged
merged 2 commits into from
Feb 15, 2021
Merged

Conversation

tcbegley
Copy link
Contributor

Hello,

This very small PR adjusts the z-index of the dash error menu container. The motivation is that the current value (1001) is lower than some common Bootstrap components resulting in the error menu being obscured in some cases. The largest z-index in Bootstrap CSS is 1070 (used for tooltips), I rounded this up somewhat arbitrarily to 1100, but could reduce to 1071 I guess.

Here is a simple example app demonstrating the issue observed with a sticky navbar

import dash
import dash_bootstrap_components as dbc
import dash_html_components as html
from dash.dependencies import Input, Output

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

navbar = dbc.NavbarSimple(
    brand="dbc.NavbarSimple", sticky="top", color="primary", id="navbar"
)

app.layout = html.Div(navbar, id="layout")


# arbitrary callback to force error menu to appear
@app.callback(Output("layout", "children"), Input("navbar", "color"))
def raise_error(_):
    raise RuntimeError


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

This was originally raised by a community member in facultyai/dash-bootstrap-components#515. I have verified that my change resolves the issue.

Happy to discuss or make any additional changes you would like.

Contributor Checklist

  • I have broken down my PR scope into the following TODO tasks
    • Adjust the z-index of dash-error-menu
  • I have run the tests locally and they passed. (refer to testing section in contributing)
  • I have added tests, or extended existing tests, to cover any new features or bugs fixed in this PR (N/A)

@alexcjohnson
Copy link
Collaborator

Thanks @tcbegley - I can't think of anything we want in front of the debug menu, other than temporary items like the plotly.js drag cover slip that has a ridiculously high z so we could even go higher if you think it might be relevant for other components. But absent any specific other value 1100 is great. @wbrgss anything from your side?

Please add a brief changelog entry indicating that this is for bootstrap compatibility and we'll be good to go!

@wbrgss
Copy link
Contributor

wbrgss commented Feb 15, 2021

Looks right to me @alexcjohnson. Thanks for the contribution @tcbegley!

@tcbegley
Copy link
Contributor Author

Thanks both! Have added a line to the changelog.

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💃 excellent, thanks again @tcbegley

@alexcjohnson alexcjohnson merged commit bee37b4 into plotly:dev Feb 15, 2021
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

Successfully merging this pull request may close these issues.

3 participants