Skip to content

selected property of MDNavigationDrawerItem don't work #1839

@Cpyte-Engine-Developer

Description

@Cpyte-Engine-Developer

Description of the Bug

When selected property of MDNavigationDrawerItem equal to True i expect that its should look like this:

Image

but not like this:

Image

Code and Logs

main.py

from test_app import TestApp


def main():
    TestApp().run()


if __name__ == "__main__":
    main()

test_app.py

from kivymd.app import MDApp


class TestApp(MDApp):
    def build(self):
        super().build()

        self.theme_cls.theme_style = "Dark"
        self.theme_cls.primary_pallete = "Blue"

test.kv

MDScreen:
    md_bg_color: self.theme_cls.backgroundColor

    MDNavigationLayout:
        MDScreenManager:
            MDScreen:
                MDButton:
                    pos_hint: {"center_x": .5, "center_y": .5}
                    on_release: nav_drawer.set_state("toggle")

                    MDButtonText:
                        text: "Open Drawer"

        MDNavigationDrawer:
            id: nav_drawer
            radius: 0, dp(16), dp(16), 0

            MDNavigationDrawerMenu:
                MDNavigationDrawerLabel:
                    text: "Mail"
                MDNavigationDrawerItem:
                    selected: True

                    MDNavigationDrawerItemLeadingIcon:
                        icon: "account"

                    MDNavigationDrawerItemText:
                        text: "Inbox"

                    MDNavigationDrawerItemTrailingText:
                        text: "24"

                MDNavigationDrawerDivider:

Versions

  • OS: LMDE 7
  • Python: 3.12
  • Kivy: 2.3.1
  • KivyMD: 2.0.1.dev0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions