Verification if there is space above the menu item selected

The verification if there is space above the menu item selected should be done only when the menu option openOnRight is true.
Before this change, the submenu is showed on top of the menu when there is space above the menu and this space can fit the submenu.