web app – Context menu being chopped off from main screen – alternative design strategies?

I am not sure if many people have experienced this before, but on desktop applications where the context menu (i.e. pop-up menu triggered by a right-click mouse selection) is used for items that is in focus, there are occasions when the UI is not optimal and the result is that sections of the menu is chopped off (see below).

enter image description here

I believe this happens when:

  • There are too many items on the contextual menu AND/OR
  • The contextual menu is triggered somewhere that is too close to the top or bottom of the screen

As you can see, even companies like Google are not immune to UI design issues like this, but I wonder if there is a more effective design strategy that will avoid poor user experiences like this.