Closed jrunestone closed 8 years ago
@swemaniac can you please provide a test case? Thanks
Hi!
Here's a demonstration. I should also mention I'm using flask-classy.
@swemaniac I was going through your example and its behavior is according to the implementation and thoughts behind default _active_when
method (https://github.com/inveniosoftware/flask-menu/blob/master/flask_menu/__init__.py#L88-L94). You can provide your own implementation of active_when
function if you want to rely only on comparison with request.endpoint
.
There might be a possibility of changing the implementation of active_item
property. If you think we should recursively check the children first in active_item
, please give us more details about your use-case which would benefit from such a change and it's not easily achievable with custom active_when
function.
I'm closing this issue as it is not a bug and we are not planning to change it unless clear use-case is provided.
Hi,
current_menu.active_item seems to always return the first active menu item and not the actual active item for the page that you are on.
I.e. if I'm in admin / users / edit and I print current_menu.active_item it returns the "admin" item, not the "edit" item.