I think It’s a bug on InDesign.
other developers mentioned same problem in the past as well.
selecting panels from Plugin panel, it works properly, but selecting from top of the menu, this not correctly works at all.
You are right, it works correctly using the plugins panel.
We have a plugin with 3 panels but this bug is preventing us from releasing it. Does anybody know if this bug is known at Adobe? Do they have a public issue tracker?
I think that might be the repository for the documentation rather than somewhere to file bugs.
I’ve seen references to https://indesign.uservoice.com/ and I see that there is a subforum there for the SDK, scripting and things like that, so that might be the place to file a bug, but I honestly don’t know.
You can sidestep the bug that panels don’t open properly from your plugin’s submenu (in the Plug-Ins menu) by removing the submenu. The user will have to open your panels from the Plugins panel but that’s OK because they do open properly from there. At least the user won’t see empty phantom panels and wonder what’s going on!
These lines of code in the create lifecycle hook for the plugin remove the submenu:
We’re referencing the Plug-ins menu in the Main menu. Then we’re referencing the submenu for our plugin by passing this.name (this here is the plugin info of our plugin). Then we are removing the submenu.
I am aware that if you need your plugin to work in different localised versions of InDesign/OS the code might need adapting a little – someone who knows more about this than I do might need to give the proper syntax.
I don’t think there are any unintended consequences to removing this submenu (if you take this code out again and reload your plugin, uxp/InDesign recreates the submenu), but please test and use at your own discretion. I am offering the code only as a workaround (hack) for the bug. Like everyone else, I wish Adobe would fix the bug.