Dropdown have to click 2 to reopen

I need urgent help with my dropdown filter. I am using a dropdown to hold the filters for isotope filter, so when something is clicked it loads into the same page.

I have used custom code js to close the menu on click, but when closed it needs to be clicked twice to reopen.


Any ideas would be appreciated.