You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can pass a function as a third parameter to the attach method, which will be called before the root menu opens.
Note that the function receives the menu definition as a parameter and also has to return it.
You can modify it as you please, but this function needs to return a valid menu definition.
As per my own documentation, you should also be able to pass a function to generate the submenu (beforeOpenSubMenu), however the Parent list item ends up being disabled.
It's been a while that I wrote this code and honestly the test coverage is at best mediocre, since it depends on manual testing,
but I am pretty sure that this is a bug.
The beforeOpenSubMenu should be called just before the submenu is being opened, but currently it is never called.
I've created a new bug #45 to track this.
I was expecting this modified example to do what you want:
You can pass a function as a third parameter to the
attach
method, which will be called before the root menu opens.Note that the function receives the menu definition as a parameter and also has to return it.
You can modify it as you please, but this function needs to return a valid menu definition.
As per my own documentation, you should also be able to pass a function to generate the submenu (
beforeOpenSubMenu
), however theParent
list item ends up being disabled.It's been a while that I wrote this code and honestly the test coverage is at best mediocre, since it depends on manual testing,
but I am pretty sure that this is a bug.
The
beforeOpenSubMenu
should be called just before the submenu is being opened, but currently it is never called.I've created a new bug #45 to track this.
Originally posted by @nkappler in #44 (comment)
The text was updated successfully, but these errors were encountered: