I found a workaround that works for now: I put a button in the back that covers the whole screen and when that is pressed I call the menu anchors close function (this means that i have to call that function on every other button if i want it to close even when i click on something). It works for now but I’m still looking for a better solution.