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

Bug: Nested Drop Down Menu doesn't work as expected #466

Open
hasansezertasan opened this issue Jan 8, 2024 · 0 comments
Open

Bug: Nested Drop Down Menu doesn't work as expected #466

hasansezertasan opened this issue Jan 8, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@hasansezertasan
Copy link
Contributor

Describe the bug

The expected result for the code below is like:

  • Parent
    • Child 1
    • Child 2
      • G Child 1
      • G Child 2

What I get is this:

  • Parent
    • Child 1
  • Child 2
    • G Child 1
    • G Child 2

To Reproduce

from starlette.applications import Starlette
from starlette_admin.base import BaseAdmin
from starlette_admin.views import DropDown, Link


app = Starlette()
admin = BaseAdmin(title="Nested Menu")
admin.add_view(
    DropDown(
        "Parent",
        icon="fa fa-server",
        views=[
            Link(
                label="Child 1",
                icon="fa fa-link",
                url="/",
            ),
            DropDown(
                "Child 2",
                icon="fa fa-server",
                views=[
                    Link(
                        label="G Child 1",
                        icon="fa fa-link",
                        url="/",
                    ),
                    Link(
                        label="G Child 2",
                        icon="fa fa-link",
                        url="/",
                    ),
                ],
            ),
        ],
    )
)
admin.mount_to(app)

Environment (please complete the following information):

  • Starlette-Admin version: [e.g. 0.12.2]
@hasansezertasan hasansezertasan added the bug Something isn't working label Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant