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

Sub context menu goes off the page if content of sub-menu is large and doesn't fit at page bottom #15678

Open
Lautern opened this issue May 23, 2024 · 0 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@Lautern
Copy link

Lautern commented May 23, 2024

Describe the bug

When context menu is called on an element located at the bottom of the page and this context menu has a large sub-context menu then this context menu goes below the page instead of being flipped.

I have found out that in primeng-contextmenu.mjs we have a class ContextMenuSub, there in function position(sublist) sublist.style.top = '0px'; is hardcoded i.e. sub menu will start from click position and goes below, there is no logic for flip calculation (as we have it in class ContextMenu for function position() )

Environment

angular 17.0.5
primeng 17.17.0
node 21.7.2
windows 10

Reproducer

https://stackblitz.com/edit/hjxyqy-cza1aw

Angular version

17.0.5

PrimeNG version

17.17.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

21.7.2

Browser(s)

Chrome 124, Firefox 124

Steps to reproduce the behavior

I created a stackbliz for reproduction:

  1. go to end of the table
  2. right-mouse click on the last element
  3. select Edit (that contains 6 sub-menu elements)
  4. observe that only several items of sub-menu are shown, all others go down causing overflow

Expected behavior

whole sub-menu being rendered in upper direction (flipped horizontally) so that all 6 entries are visible

@Lautern Lautern added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

1 participant