I can't press buttons behind a hidden screen

I am working on creating my own version of QuizU to implement into my application. Following the approach of QuizU, I have developed my own versions of the UIManager.cs, UIEvents.cs, SequenceManager.cs, and MainMenuScreen.cs scripts. Additionally, I have created several other Screen.cs scripts along with their corresponding .Uxml files, as the template requires. I also have a main .Uxml file that contains all the other .Uxml files, and it is used to display the different screens based on the state of the StateMachine.

The issue I am facing is as follows: inside the Screens.Uxml file, which contains all the other .Uxml files, I cannot interact with the buttons if the enabled .Uxml is behind another one that is hidden. It seems I am unable to click on elements behind a hidden screen, and I don’t understand why this is happening. If I reorder the .Uxml files and place the active screen on top, I am able to interact with the buttons that I couldn’t before.

Could anyone help me understand why this is happening and how to resolve it?

The picking mode of visual elements determines whether they take or ignore pointer inputs: Unity - Scripting API: UIElements.VisualElement.pickingMode

So if you are hiding elements, but the overlay still has, for example, a background visual element with PickingMode.Position, it will still swallow inputs from the overlay under it.

But question is are you hiding the UI overlays? I would probably be setting the root visual element to style.display = DisplayStyle.None so its not just invisible, but also not being used in any other calculations or queries.