starlette-admin
starlette-admin copied to clipboard
Bug: Nested Drop Down Menu doesn't work as expected
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]