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

Component: Menu #14169

Closed
kevinley opened this issue Nov 21, 2023 · 2 comments
Closed

Component: Menu #14169

kevinley opened this issue Nov 21, 2023 · 2 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@kevinley
Copy link
Contributor

Describe the bug

When the menu is opened from a button that has position fixed on the page, it is attached correctly.
But when scrolling the page first, then opening the menu, the position of the menu is somewhere on the page -> wrong top value.

I expect the menu to always open in the same position relative to the element triggering it or the target.

Environment

.

Reproducer

No response

Angular version

16

PrimeNG version

16.6

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

16

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

@kevinley kevinley added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 21, 2023
@cetincakiroglu
Copy link
Contributor

Hi,

Could you please share a stackblitz example so we can identify the issue?

@Kapelianovych
Copy link

It may not be related, but consider the following template.

<main>
  <header></header>
  <div>
    <p-button label="Open menu" (click)="menu.toggle($event)" />
    <p-menu #menu [model]="someItems" [popup]="true" />
  </div>
</main>
<style>
  div {
    position: absolute;
    top: 100px;
    left: 0px;
  }
</style>

When menu opens, it receives the top CSS property relative to the viewport, but menu's parent has position: absolute causing menu in fact to be relative to that div and not the viewport. Thus, the actual position of the menu is 100px farther than it should be.

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

4 participants