inveniosoftware / flask-menu

Flask-Menu is a Flask extension that adds support for generating menus.
https://flask-menu.readthedocs.io
Other
53 stars 45 forks source link

Multiple routes can appear active at the same time #58

Closed mordae closed 7 years ago

mordae commented 7 years ago

When I navigate to the longer of the following two routes, both are considered active:

/test/hello
/test/hello-and-bye

Is this by design or mistake?

jirikuncar commented 7 years ago

It's a default behavior (see https://github.com/inveniosoftware/flask-menu/blob/master/flask_menu/__init__.py#L89-L95). You can provide custom active_when method that compares only endpoint names.