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

[context-menu] Add API to define position preference of the ContextMenu when it has a target element. #8499

Open
TatuLund opened this issue Jan 13, 2025 · 0 comments
Labels

Comments

@TatuLund
Copy link
Contributor

Describe your motivation

This should be analogous to Popover component.

When ContextMenu has a target element it now opens at the mouse cursor position so that one of the corner is at cursor position, e.g. top left or top right depending on available space.

In some applications it would be visually better if the ContextMenu would open in similar fashion than Popover, e.g. slightly below the target component, or above it.

Describe the solution you'd like

I think the most intuitive approach would be to use similar API as Popover

public enum PopoverPosition {
    //@formatter:off
    TOP_START("top-start"),
    TOP("top"),
    TOP_END("top-end"),
    BOTTOM_START("bottom-start"),
    BOTTOM("bottom"),
    BOTTOM_END("bottom-end"),
    START_TOP("start-top"),
    START("start"),
    START_BOTTOM("start-bottom"),
    END_TOP("end-top"),
    END("end"),
    END_BOTTOM("end-bottom");
    //@formatter:off
...

Describe alternatives you've considered

No response

Additional context

Mobile mode does not need to be overriden by this setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants