Disappearing MenuItem

In my title bar I have a MenuBar with MenuItems for New, Save, Delete.
This worked fine, but then I added code to add/remove a “dirty” css class to the Save entry.

When I add the class it works as expected, but when I remove it again, all the MenuBarItems in the MenuBar disappears from the web page!

When dirty:

After save:

If i comment out the line where I do saveButton.removeClassName("screen-dirty"); then it works again

I’ve tried to reproduce in a small example view, but then it works just fine.

Any idea what might be going on?

Sounds like a similar bug to this Setting themeNames causes SubMenu to fail once · Issue #6577 · vaadin/flow-components · GitHub - I would suggest to report it on GitHub.

Sounds related but that one was closed in 24.5.0 (?)
I’m on 24.6.0

It seems pointless to report it as long as I can’t provide a reproducible example

Does this issue match your use case? If your use case is similar, but a bit different, please add a comment so that the product team also knows about that case