Fix show sub menu

Rebase of #1926
Hopefully tests will work after rebasing

Fixes #1913