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

Submenus containing multiple items may sometimes be displayed outside of the viewport #50

Closed
Mahenintsoa opened this issue Feb 27, 2024 · 1 comment

Comments

@Mahenintsoa
Copy link

Observed Behaviour

When a submenu with several items is opened from a menu that already appears at the bottom of the viewport, the submenu is displayed incorrectly the first time.

image

Reproducer

I've made a simple html file to reproduce the issue if needed
example-ctxmenu.zip

Possible fixes

It appears that when the direction is set to "u", the code no longer takes the height of the submenu into account when calculating the vertical position.

@nkappler
Copy link
Owner

That's an excellent catch, thank you.
Honestly, ever since it was discovered that the positioning code breaks down, when zoom is applied to the page, the code to determine the correct position has grown into a bit of a mess.
I'm currently in the middle of a bigger refactoring, so I totally expect this code to change in the near future.

In the meantime, I'll merge your fix and release a patch. Thanks for your contribution.

nkappler added a commit that referenced this issue Feb 27, 2024
fix #50 correctly displays submenu at the bottom of the viewport
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants