Prevent passing clicks through UI

I have UI Canvas with Panel and buttons inside, and other UI Canvas under previous one with button also. Now click are passing through the front Canvas. How can I disable clicks passing through the front UI to all UI`s under it?

Thank you!

The lowest canvas in the hierarchy will be the one at the front and should block raycasts unless its SetActive has been set to false or it has a canvas group on it with blocksRaycast unticked.

Just move the cavas to the lowest in the hierarchy.

Disable the Canvas that you don’t want to use.