Giter Club home page Giter Club logo

Comments (11)

snehilvj avatar snehilvj commented on May 28, 2024

Hi @blanning19
Can you share an MRE? I run this code and see now issues.

import dash_mantine_components as dmc
import dash_bootstrap_components as dbc

from dash import html, Output, Input, State, callback, Dash

app = Dash(__name__)

app.layout = html.Div(
    [
        dmc.Button("Open Modal", id="modal-demo-button"),
        dbc.Modal(
            id="modal",
            children=[
                dmc.MultiSelect(
                    label="Select 3D-axis plot variables:",
                    id="selected-3d-attr",
                    value=[],
                    data=[
                        {"value": "parameter1", "label": "Parameter1"},
                        {"value": "parameter2", "label": "Parameter2"},
                        {"value": "attribute1", "label": "Attribute1"},
                        {"value": "attribute2", "label": "Attribute2"},
                    ],
                    creatable=True,
                    clearable=True,
                )
            ],
            style={"height": "60vh", "overflow": "scroll"},
        ),
    ]
)


@callback(
    Output("modal", "is_open"),
    Input("modal-demo-button", "n_clicks"),
    State("modal", "is_open"),
    prevent_initial_call=True,
)
def modal_demo(nc1, is_open):
    return not is_open


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

from dash-mantine-components.

blanning19 avatar blanning19 commented on May 28, 2024

from dash-mantine-components.

snehilvj avatar snehilvj commented on May 28, 2024

Can you share the screenshots again. Don't think they were attached successfully here.

from dash-mantine-components.

blanning19 avatar blanning19 commented on May 28, 2024

from dash-mantine-components.

blanning19 avatar blanning19 commented on May 28, 2024

from dash-mantine-components.

blanning19 avatar blanning19 commented on May 28, 2024

from dash-mantine-components.

snehilvj avatar snehilvj commented on May 28, 2024

Hi @blanning19
I am not able to reproduce this issue. Dropdowns are working fine for me in a modal. I think the code you shared is not complete. Also I'm not able to see the attached screenshots. Better to attach them directly in the comment thread rather than via mail.

from dash-mantine-components.

blanning19 avatar blanning19 commented on May 28, 2024

from dash-mantine-components.

AnnMarieW avatar AnnMarieW commented on May 28, 2024

Hi @blanning19

When posting an issue, it's important to include a complete minimal example that can be copied, pasted, and run by someone else to reproduce the error you are seeing. For more info on how to do this, see the Dash Community forum post - How to get your questions answered on the forum. It would also be good to post your question on the forum first, in case it's just a "how-to" issue and not a bug.

Here's more info on how to include files and images in a GitHub issue or pull request.

I also created an example, and I was able to replicate what you are seeing. The issue looks like the dropdown options are behind the modal. This can be fixed by using the zIndex prop. Here's what the example code posted below looks like with the zIndex prop commented out.

dmc_dropdown

Here's an image of the working dropdown - just make the zIndex prop not commented out in the example below
image

from dash import Dash, html
import dash_bootstrap_components as dbc
import dash_mantine_components as dmc

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

app.layout = html.Div(
    [
        dmc.Button("Open Modal", id="modal-demo-button"),
        dbc.Modal(
            id="modal",
            children=[
                dmc.MultiSelect(
                    label="Select 3D-axis plot variables:",
                    id="selected-3d-attr",
                    value=[],
                    data=[
                        {"value": "parameter1", "label": "Parameter1"},
                        {"value": "parameter2", "label": "Parameter2"},
                        {"value": "attribute1", "label": "Attribute1"},
                        {"value": "attribute2", "label": "Attribute2"},
                    ],
                    creatable=True,
                    clearable=True,
                    zIndex=2000

                ),
                dmc.MultiSelect(
                    label="Select 3D-axis plot variables2:",
                    id="selected-3d-attr2",
                    value=[],
                    data=[
                        {"value": "parameter1", "label": "Parameter1"},
                        {"value": "parameter2", "label": "Parameter2"},
                        {"value": "attribute1", "label": "Attribute1"},
                        {"value": "attribute2", "label": "Attribute2"},
                    ],
                    creatable=True,
                    clearable=True,
                    zIndex=2000
                )


            ],
            style={"height": "60vh", "overflow": "scroll"},
            is_open=True
        ),
    ],
)


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

from dash-mantine-components.

blanning19 avatar blanning19 commented on May 28, 2024

from dash-mantine-components.

snehilvj avatar snehilvj commented on May 28, 2024

Thanks @AnnMarieW

from dash-mantine-components.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.