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

Desktop: Fixes #9953, #9948: Rich text editor: Fix context menu not shown in some cases #9954

Conversation

personalizedrefrigerator
Copy link
Collaborator

Summary

The logic for showing a context menu in the rich text editor was incorrect in two cases:

  • The editor was zoomed in
  • The editor was hidden behind another element.

This is fixed by adjusting the logic that accounts for the page's current zoom and using document.elementFromPoint.

Fixes #9953 and #9948.

Testing

  1. Create a note with a large amount of text.
  2. Open it in the rich text editor.
  3. Attach an image.
  4. Zoom in such that the image is near the bottom/right edge of the screen.
  5. Right click along the right and bottom edges of the screen. Verify that the correct context menu is shown.
  6. Add a code block such that the code block dialog is open.
  7. Right click in the part of the code block dialog that overlaps the rich text editor. Verify that a right click menu is shown and can be used to paste text.

This has been tested successfully on Ubuntu 23.10.

Screencast.from.2024-02-16.13-54-24.webm

@personalizedrefrigerator personalizedrefrigerator linked an issue Feb 16, 2024 that may be closed by this pull request
@personalizedrefrigerator personalizedrefrigerator changed the title Desktop: Fixes #9953, #9948: Rich text editor: Fix context menu not shown Desktop: Fixes #9953, #9948: Rich text editor: Fix context menu not shown in some cases Feb 17, 2024
@laurent22 laurent22 merged commit e2a79c1 into laurent22:dev Feb 19, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants