Defect #5908
closedContext menu submenus can extend beyond the window
Added by Aaron Parks over 16 years ago. Updated about 9 hours ago.
Description
When using Firefox the right click menu does not leave enough room for submenus and their appear off screen (see scr)
Files
| WeirdDraw.png (93.9 KB) WeirdDraw.png | Example of submenu that cannot be accessed. | Aaron Parks, 2010-07-19 20:54 | |
| contextmenuMisplacement.png (21.9 KB) contextmenuMisplacement.png | example of misplaced context menu | Daniel Felix, 2013-01-15 10:28 | |
| 0001-Fix-context-menu-and-its-submenus-extending-beyond-t.patch (5.4 KB) 0001-Fix-context-menu-and-its-submenus-extending-beyond-t.patch | Go MAEDA, 2026-11-21 09:15 | ||
| 0002-Remove-commented-out-code-for-IE-from-context_menu.j.patch (875 Bytes) 0002-Remove-commented-out-code-for-IE-from-context_menu.j.patch | Go MAEDA, 2026-11-21 09:15 | ||
| context-menu-5908-before.png (14.3 KB) context-menu-5908-before.png | Go MAEDA, 2026-11-21 09:21 | ||
| context-menu-5908-after.png (14.6 KB) context-menu-5908-after.png | Go MAEDA, 2026-11-21 09:21 |
Updated by Felix Schäfer over 16 years ago
Actions
#1
IIRC this wasn't firefox-only nor are you the first to notice it, pretty sure there already is a ticket for this. Could you try to find it so we can mark this one a duplicate of the other?
Updated by Aaron Parks over 16 years ago
Actions
#2
Updated by Felix Schäfer over 16 years ago
Actions
#3
There's a proposed patch in #6053, haven't tested it though.
Updated by Felix Schäfer over 16 years ago
Actions
#4
- Category set to UI
Updated by Daniel Felix almost 14 years ago
Actions
#5
- File contextmenuMisplacement.png contextmenuMisplacement.png added
- Status changed from New to Confirmed
- Affected version (unused) changed from devel to 2.2.1
- Affected version set to 2.2.1
I can confirm this in the current Redmine Release (2.2.1) with current Firefox Release (18).
The rendering isn't weird anymore but the placement of the contextmenu could be realy improved (see screenshot attached).
This could be forced by a smaller window height and some scrolling (you need to scroll 50-80px downwards - depending on your theme). There's enough place to display it beneath, but instead it's display above, which causes the loss of the edit link.
In my opinion, the context menu doesn't respect the current viewport of the user for the calculation for it's position.
Updated by Go MAEDA 12 days ago
Actions
#6
- File 0001-Fix-context-menu-and-its-submenus-extending-beyond-t.patch 0001-Fix-context-menu-and-its-submenus-extending-beyond-t.patch added
- File 0002-Remove-commented-out-code-for-IE-from-context_menu.j.patch 0002-Remove-commented-out-code-for-IE-from-context_menu.j.patch added
- File context-menu-5908-before.png context-menu-5908-before.png added
- File context-menu-5908-after.png context-menu-5908-after.png added
- Subject changed from Odd rendering of right click menu in Firefox to Context menu submenus can extend beyond the window
- Target version set to Candidate for next minor release
I confirmed that this issue still occurs with Firefox 160 on the current trunk. It also occurs in Chrome, because the cause is in the JavaScript that positions the context menu.
To reproduce it:
1. Open the issue list in a browser window that is about 600 to 800 pixels high.
2. Right-click an issue near the vertical middle of the window. The context menu does not fit below the pointer, so it opens above it and is moved to the top of the window.
3. Hover over the "Status" submenu.
The submenu opens upward even though the menu is at the top of the window, so it extends beyond the top of the window and its upper items cannot be seen or selected. When the page is scrolled down, the context menu itself can also be placed above the top of the window.
The attached patch makes the following changes in context_menu.js:
- Each submenu opens in the direction where it fits, based on the measured space above and below its item. Previously, the direction was decided by fixed thresholds (325px and 345px), and all submenus opened upward when the menu was displayed above the pointer.
- If a submenu does not fit in either direction, its height is limited so that it can be scrolled.
- The top of the context menu is kept inside the visible area, taking the scroll position into account.
One limitation remains: if the context menu itself is taller than the window, its lower part still extends below the window, although it can be reached by scrolling the page.
#6053 reports the same problem, so I think it can be closed as a duplicate.
| Before | After |
|---|---|
![]() |
![]() |
Updated by Marius BĂLTEANU about 9 hours ago
Actions
#9
- Status changed from Resolved to Closed
Merged both fixes to stable branches, thanks!

