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

fix(files): Right click menu position #44136

Closed
wants to merge 2 commits into from
Closed

Conversation

Pytal
Copy link
Member

@Pytal Pytal commented Mar 11, 2024

Summary

  • Because the actions menu is contained within the files list already, meaning that transform: translate3d(0px, 0px) sticks the menu to the top right of the files list, we set the correct root to the files list element
  • For the x position we now subtract the the contentRect.left to always take the sidebar into account
    • Previously we just used clientX which is relative to the viewport rather than the files list container
  • For y sometimes event.clientY - contentRect.top is greater than contentRect.top e.g. for the first file but since the menu is already in the container we can remove the Math.max and just subtract the contentRect.top
Before After
image image

Checklist

Pytal added 2 commits March 11, 2024 12:49
Signed-off-by: Christopher Ng <[email protected]>
@Pytal Pytal added this to the Nextcloud 29 milestone Mar 11, 2024
@Pytal Pytal requested review from susnux, artonge and szaimen March 11, 2024 20:13
@Pytal Pytal self-assigned this Mar 11, 2024
@Pytal Pytal requested a review from skjnldsv as a code owner March 11, 2024 20:13
@Pytal Pytal enabled auto-merge March 11, 2024 20:13
@Pytal
Copy link
Member Author

Pytal commented Mar 11, 2024

/backport to stable28

@SystemKeeper
Copy link
Contributor

Bildschirmaufnahme.2024-03-11.um.22.26.29.mov

Works for me only when the menu opens to the bottom. If it opens to the top, it is still mis-aligned.

@SystemKeeper
Copy link
Contributor

Bildschirmaufnahme.2024-03-11.um.22.32.14.mov

Also it only works when we have not scrolled the files list, ref #43300

@Pytal Pytal closed this Mar 11, 2024
auto-merge was automatically disabled March 11, 2024 23:32

Pull request was closed

@Pytal Pytal deleted the fix/right-click-position branch March 11, 2024 23:32
@skjnldsv skjnldsv removed this from the Nextcloud 29 milestone Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Right click menu wrong position
3 participants