I’ve had this issue a couple times over the years and can never find a good solution elsewhere when it’s happened.
Luckily, in both my cases the solution was simple. The kind of simple where that’s why it was hard to solve at first, because I wouldn’t have suspected the cause to be the thing.
Cut to the chase:
I’d placed custom CSS code that increases the indent of unordered lists into the “Custom CSS” area of WordPress’ theme settings. I’d actually checked this area once before discovering this was the culprit, but the first time looking through all the customizations I’d made this code didn’t strike me.
Then it occurred to me that WordPress treats the navigation menu as an unordered list, even if it isn’t presented that way. Perhaps otherwise inane-looking tweaks to list margins are screwing up how the menu functions.
Commented that code out and refreshed the front end of the site. Sure enough, the menu dropdowns worked like a charm and didn’t keep vanishing as I moved my cursor from the top level item to the ones beneath it.
As I was doing my initial Googling about the issue trying to solve the problem it seemed there were a lot of variations of these types of edits. While they differed just enough that they didn’t solve it for me, it says to me that edits to indents and margins for stylistic things like lists are pretty common changes.
That’s why I’m sharing this fairly simple post, in case someone out there having the same issue and not having much luck could benefit from this.