Each menu item is called once for the number of items added. If I add 3 menu items and click one, it is called 3 times. If I add another, it's called 4 times.
To reproduce, use the example from the documentation, replacing alert with console.log and duplicate it a few times (with a different name and output, for clarity). Upon clicking the menu item, it will be fired as many times as there are menu items.
How to repeat issue and example
Each menu item is called once for the number of items added. If I add 3 menu items and click one, it is called 3 times. If I add another, it's called 4 times.
To reproduce, use the example from the documentation, replacing
alert
withconsole.log
and duplicate it a few times (with a different name and output, for clarity). Upon clicking the menu item, it will be fired as many times as there are menu items.Clicking
Say Hello #1
will result in 3x "Hello 1!
" in the console log.