Skip to content

Commit

Permalink
directly selecting a node with submenu
Browse files Browse the repository at this point in the history
A
-> A.1
-> A.2

Selecting a menu item with a submenu (A) will always call _process_breadcrums() on all submenu items (A.1, A.2)
If non of the submenu items is selected, the parent node is also not selected.

Selecting A.1 will work and select A.
Directly selecting A will not mark A as selcted, as neither A.1 nor A.2 are selected.

fixes LaLogiaDePython#16
  • Loading branch information
stfl authored Oct 4, 2021
1 parent e0d733a commit 2d16a57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion menu_generator/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def _process_breadcrums(self, menu_list):
can be used as breadcrumbs
"""
for item in menu_list:
if item['submenu']:
if not item['selected'] and item['submenu']:
item['selected'] = self._process_breadcrums(item['submenu'])
if item['selected']:
return True
Expand Down

0 comments on commit 2d16a57

Please sign in to comment.