The will be difficult to achieve as the map is acting as it should. When the mouse is over the popup, it is no longer on the layer, thus the mouse leave event fires.
A common workflow for this scenario is to show a preview when the user hovers. But when they click on the layer, have the popup stay open until they either click somewhere else on the map or press the close button of the popup. To achieve this you would need to do something like this:
- Add mouse enter/leave and click events to layer. On enter, open popup. On leave, close popup. On close, remove enter/leave events, open popup.
- When popup is closed after a click locked it open, re-add the mouse enter/leave events