By filtering the array returned by menuActions, an empty menu will not be shown when all child actions are not visible.
Example: