Skip to content

[context-menu] flicker when context menu has to rendered to the left of the mouse pointer due to space restrictions #8759

@enver-haase

Description

@enver-haase

Description

When the context menu cannot be rendered to the right of the mouse pointer, it is being rendered on the left. Unfortunately, the rendering starts on the right with the blend-in effect and only afterwards it is moved to the left. The outcome is unpleasant flicker.

Expected outcome

The calculation should take place first so that the context menu is either rendered on the right or on the left without any flicker.

Minimal reproducible example

Go to https://vaadin.com/docs/latest/components/context-menu
and shrink the browser window horizontally so that there is very little space on the right of the grids.

Screen.Recording.2025-03-04.at.10.25.41.mov

Steps to reproduce

Go to https://vaadin.com/docs/latest/components/context-menu
and shrink the browser window horizontally so that there is very little space on the right of the grids.
Use the first grid. Right-click on the rightmost place inside the grid.

Environment

Vaadin version(s): latest
OS: Windows / macOS

Browsers

Firefox, Chrome

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions