diff --git a/kivymd/uix/navigationbar/navigationbar.py b/kivymd/uix/navigationbar/navigationbar.py index e2f45cc05..7f823a603 100644 --- a/kivymd/uix/navigationbar/navigationbar.py +++ b/kivymd/uix/navigationbar/navigationbar.py @@ -585,6 +585,11 @@ def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) Clock.schedule_once(self.set_status_bar_color) + def get_active_item(self) -> MDNavigationItem | None: + """Returns the currently active item in the navigation bar.""" + + return next((child for child in self.children if child.active), None) + def set_active_item(self, item: MDNavigationItem) -> None: """Sets the currently active element on the panel."""