Context menu off screen

when opening the context menu when clicking on a shape, it can appear off-screen (the client-rectangle) of the browser. The context menu should position itself automatically to not cutoff the bottom edge.