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

ContextMenu: Y axis collision detection not working for submenus #6348

Closed
m1keyboy opened this issue Sep 6, 2024 · 5 comments
Closed

ContextMenu: Y axis collision detection not working for submenus #6348

m1keyboy opened this issue Sep 6, 2024 · 5 comments
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@m1keyboy
Copy link

m1keyboy commented Sep 6, 2024

Describe the bug

When using the ContextMenu component that contains nested items, the displayed submenu does not perform collision detection on the Y axis. It looks like some improvements were recently attempted here - cba43b3#diff-c6ca045bcd1ffaee382f973a803ba6be86a152e0cb4c07780b955e047d79fc0c - but that appears to only be concerned with the X axis.

Reproducer

https://stackblitz.com/edit/primevue-4-vite-issue-template-ccakui?file=src%2FApp.vue

PrimeVue version

4.0.5

Vue version

4.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

Chrome 128.0.6613.115

Steps to reproduce the behavior

  1. Goto https://stackblitz.com/edit/primevue-4-vite-issue-template-ccakui?file=src%2FApp.vue
  2. Right click near the bottom of the viewport
  3. Expand the 'Speech' item

Expected behavior

Submenus within the ContextMenu component should also perform collision detection on the Y axis. Where possible, if a submenu is going to collide with the top/bottom edge of the viewport, the submenu orientation should flip.

@m1keyboy m1keyboy added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Sep 6, 2024
@LukeGarrigan
Copy link

Getting this too

@daledev-uk
Copy link

This is becoming a real problem for our users, any updates?

@andrew-cmdltt
Copy link

Yes, Y offset for sub ContextMenu items is really necessary especial in GIS maps where maps fit all screen resolution. It's not difficult to write your own nestedPosition function, but that would be good to include this logic in the original function.

@mertsincan mertsincan added this to the 4.2.0 milestone Oct 30, 2024
@mertsincan mertsincan added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Oct 30, 2024
@mertsincan
Copy link
Member

Thanks a lot for your PR, @andrew-cmdltt ;)

@andrew-cmdltt
Copy link

Thanks a lot for your PR, @andrew-cmdltt ;)

Glad to be my contribution useful:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

No branches or pull requests

5 participants