Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Left Click Menu Is Being Placed Above Top of screen for menus with many items #2704

Closed
wsimon opened this issue Oct 4, 2023 · 14 comments
Closed

Comments

@wsimon
Copy link
Contributor

wsimon commented Oct 4, 2023

Describe the bug
We have a long menu that gets placed above the top of the screen so that the items at the top are not clickable. This is the menu that I am referring to:
https://github.com/VirtoCommerce/vc-platform/blob/dev/src/VirtoCommerce.Platform.Web/wwwroot/js/common/directives/left-click-menu.js

Steps to reproduce
Steps to reproduce the behavior:

  1. 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.
  2. Click to open the menu
  3. 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 menu to become scrollable if it doesn't fit and not go off screen

Version info (please complete the following information):

  • Browser version: latest Chrome on desktop Version 117.0.5938.132
  • Platform version: 3.316.0
@mvktsk
Copy link
Contributor

mvktsk commented Oct 4, 2023

Task https://virtocommerce.atlassian.net/browse/VP-8454 has been created

@OlegoO
Copy link
Contributor

OlegoO commented Oct 11, 2023

@wsimon Could you attach any screenshots or gif?

@wsimon
Copy link
Contributor Author

wsimon commented Oct 12, 2023

Yeah so for example, in this screenshot we have a long alphabetized list in the menu. It is long enough, it goes under the header and the top items that start with A-C are not selectable.
image

@OlegoO
Copy link
Contributor

OlegoO commented Oct 17, 2023

Added PR: #2713

@wsimon
Copy link
Contributor Author

wsimon commented Oct 18, 2023

Hi thanks for the quick work. But it seems there is an issue with the fix- it seems to break the submenu. Hovering over profile or location should pop out the submenu to the right. It is now behind the top menu.
image

@OlegoO
Copy link
Contributor

OlegoO commented Oct 18, 2023

Thank you for feedback

@OlegoO
Copy link
Contributor

OlegoO commented Oct 20, 2023

@wsimon please check VirtoCommerce/vc-module-core#219

@wsimon
Copy link
Contributor Author

wsimon commented Oct 20, 2023

@OlegoO That works for us. Thanks.

@OlegoO
Copy link
Contributor

OlegoO commented Oct 22, 2023

We are planning to release it in Monday

@OlegoO OlegoO closed this as completed Oct 24, 2023
@wsimon
Copy link
Contributor Author

wsimon commented Nov 1, 2023

Hi @OlegoO . We tried updating to the latest release and 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

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

@Dan-BV
Copy link

Dan-BV commented Nov 14, 2023

Hi, @wsimon !
Could you please answer a few clarifying questions:

  1. How many items does your menu contain?
  2. What screen resolution are you testing on?
  3. Could you provide temporary access to your environment for testing?

@wsimon
Copy link
Contributor Author

wsimon commented Nov 14, 2023

@Dan-BV Thanks for your help.

  1. There are 44 items in the menu
  2. 1366 x 768
  3. I can't as it is only accessible on our internal network

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants