Mobile menu active when its closed

I am using this mobile menu on my forum. It works perfectly fine on desktop.

But when on mobile, it seems like the menu opens randomly (when it’s not supposed too), but it’s invisible. And then when the user click somewhere on the forum it takes them to a link thats on the mobile menu (depending on the they click).

the only thing I edited from the original code was the z-index and I changed that to 10.

It’s also really hard to recreate this problem because I can’t seem to figure out what triggers it, and it just happens randomly.