Skip to content

[context-menu] The menu can be not positioned correctly in certain circumstances [1 day] #3972

Open
@vursen

Description

@vursen

Description

Here is a recording that demonstrates the issue:

Screen.Recording.2022-05-31.at.13.27.26.mov

The incorrect positioning for some reason takes place when there is a lack of bottom space.

Expected outcome

The context-menu should be correctly positioned relative to the target.

Minimal reproducible example

<body>
  <div style="padding: 500px 0;">
    <vaadin-context-menu>
      <button>Click me!</button>
    </vaadin-context-menu>
  </div>
</body>

<script type="module">
  import '@vaadin/context-menu';

  const menu = document.querySelector('vaadin-context-menu');
  menu.items = [
    { text: 'Menu Item 1' },
    { text: 'Menu Item 2' },
    { text: 'Menu Item 3' },
  ];
</script>

Steps to reproduce

  1. Add the snippet above to an HTML page
  2. Make sure the target button is at the very bottom of the screen. If not, adapt the viewport size.
  3. Click the target button.

Environment

Vaadin version(s): 23
OS: Mac OS Monterey

Browsers

Issue is not browser related

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions