Perminantly closing group when not hovered

Hi all,
I have created from scratch my own dropdown- as in a set of groups that looks and feels like the dropdown element but isnt as I have very specific needs.

I need to know how to permanently close the dropdown when it isnt hovered. The condition of when this dropdown isnt hovered > it is not visible means that when users then hover that area again it re appears. When users use the dropdown is closes when they select an option- but if they open the dropdown and dont end up clicking an option- how can I close it?