VirtoCommerce/vc-platform

Menu is still being placed above the top of the screen

wsimon opened this issue · 4 comments

wsimon commented

Describe the bug
Originally reported this issue with #2704.

We updated to the latest release and though it has improved, we are still seeing the original issue even though the menu has a scrollbar. We click this select attribute link and the menu opens but the top of it is off screen and now it doesn't open next to the link where we click but further up on the screen.

image

Steps to reproduce
For any place where that left-click-menu is being used, configure the items in it to have a lot and/or shrink your screen/window down.
Click to open the menu
The top of the menu is above the top of the screen/window so that the top menu items are not selectable.

Expected behavior
I would expect the top of the menu to be on screen

Version info (please complete the following information):
Browser version: latest Chrome on desktop
Platform version: 3.431.0

Additional context (optional)
I wonder if this javascript is going to have to change, because this is where it calculates what to set the top property of the menu. At the very least, it should probably do a Math.max(0, top) but it might need more to take into account that the height of the menu is no longer greater than 70% of the viewport height so that it is properly aligned with the element that opened it:
https://github.com/VirtoCommerce/vc-platform/blob/dev/src/VirtoCommerce.Platform.Web/wwwroot/js/common/directives/left-click-menu.js#L53

OlegoO commented

@wsimon please review #2728 this PR, it should fix the problem.

image

wsimon commented

@OlegoO Thanks! I tested out that change and it looks like it fixes the issue. Looks great!