Menu on mobile and tablet closing immediately after opening

Hello Dave,
Thank you for your answer. I found the issue thanks to you, but didn’t solve it.
The issue is that I use custom code for auto switch tabs and this is causing the menu on mobile to close (AutoPlay Tabs - Any ideas? - #5 by pepperclip)

They mentioned a solution there but it doesn’t work for me…