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

Fixing access to MenuTarget.boxWrapperProps #309

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

datenzauberai
Copy link

This would fix #285.

from dash import Dash, _dash_renderer
import dash_mantine_components as dmc
from dash_iconify import DashIconify

_dash_renderer._set_react_version("18.2.0")

app = Dash(external_stylesheets=dmc.styles.ALL)


def menu_layout(boxWrapperProps):
    return dmc.Menu(
        [
            dmc.MenuTarget(
                dmc.Button("Click for options!", fullWidth=True), boxWrapperProps=boxWrapperProps
            ),
            dmc.MenuDropdown(
                [
                    dmc.MenuItem(
                        "External Link",
                        href="https://www.github.com/snehilvj",
                        target="_blank",
                        leftSection=DashIconify(icon="radix-icons:external-link"),
                    ),
                    dmc.MenuItem("Useless Button"),
                ]
            ),
        ]
    )

app.layout = dmc.MantineProvider(
    dmc.Container(
        dmc.Stack([
            menu_layout({}),
            menu_layout({"w": "300px"}),
            menu_layout({"w": "100%"})
        ], align="center", gap="md"),
        style={"padding": "1rem"}
    ),
    id="theme-provider",
    forceColorScheme="light"
)

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

@AnnMarieW
Copy link
Sponsor Collaborator

Hi @datenzauberai
Thanks so much for the PR!

@snehilvj, I checked out this PR and ran the sample app to verify that it works and will fix the issue as reported in # 285. It would be great to get this in the next release.

@datenzauberai would you like to include a changelog entry as well?

@datenzauberai
Copy link
Author

@datenzauberai would you like to include a changelog entry as well?
Sure, though I don’t really know what that exactly means 😁 could you give me a hint?

@AnnMarieW
Copy link
Sponsor Collaborator

Sure, though I don’t really know what that exactly means 😁 could you give me a hint?

Haha, yeah, I could have been a little more specific 😛

In the CHANGELOG.md Unreleased section, add a short description and the PR number, something like:

### Fixed

- `boxWrapperProps` in the `MenuTarget` component #309

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.

MenuTarget boxWrapperProps property does not work with setting "width"
2 participants