Bug 836066 - right click opens browser native context menu instead of application's
right click opens browser native context menu instead of application's
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-webadmin-portal (Show other bugs)
unspecified
Unspecified Unspecified
high Severity unspecified
: ---
: ---
Assigned To: Shahar Havivi
Pavel Stehlik
ux
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-27 22:53 EDT by Itamar Heim
Modified: 2012-12-04 15:06 EST (History)
8 users (show)

See Also:
Fixed In Version: si18
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-12-04 15:06:53 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
right-click (493.91 KB, video/ogg)
2012-09-14 08:08 EDT, Pavel Stehlik
no flags Details

  None (edit)
Description Itamar Heim 2012-06-27 22:53:34 EDT
sample scenario:
when i click hosts main tab.
if i right click on a host before the subtab appears i get the normal 
browser context menu rather than the application one.
Comment 1 Itamar Heim 2012-06-27 22:57:50 EDT
vojtech commented:
> Right-clicking unselected grid item causes the default browser context menu to > appear.
> Right-clicking selected grid item shows the application context menu.
> I suspect this is a bug in AbstractActionTable/AbstractActionPanel right-click > handler registration.

Vojtech, I see two bugs:
1. right clicking on "empty" areas of the grid - always reproduces the issue.
2. right clicking on a 'host' quickly after selecting the hosts tab will also reproduce this issue, even though the host is selected.
(I'd attach a screenshot, but hitting print-screen causes the context menu to disapper...)
Comment 2 Shahar Havivi 2012-09-03 10:49:52 EDT
I can reproduce it in google chrome but not in Firefox.
its look like chrome bug???

I did send a patch that override the normal right click context menu.

any other ideas?
Comment 3 Shahar Havivi 2012-09-03 10:50:18 EDT
posted at: http://gerrit.ovirt.org/#/c/7716/
Comment 4 Itamar Heim 2012-09-03 11:54:21 EDT
reproduced easily (for #1) on 3.1.0-14.el6ev with firefox 12 and IE 8
Comment 5 Shahar Havivi 2012-09-03 16:03:33 EDT
(In reply to comment #4)
> reproduced easily (for #1) on 3.1.0-14.el6ev with firefox 12 and IE 8
I didn't put it right...
It is reproducible in all browsers since its the context menu and we don't handle every widget right click context menu - my patch fix that.

the problem that I encounter (after applying my patch) in chrome is when first clicking on the main grid such as Hosts, the first click will always popup the native chrome context menu and the second is the grid widget context menu.

its look like only for the main grid (not the sub tab grids) and not for the tree so its a local bug? (and again google chrome only).
Comment 6 Daniel Erez 2012-09-05 08:39:44 EDT
What about VNC dialog? Copying connection information is done through browser's native context menu. Additionally, we might want text copy ability on some other dialogs.
Comment 7 Daniel Erez 2012-09-05 08:50:44 EDT
What about VNC dialog? Copying connection information is done through browser's native context menu. Additionally, we might want text copy ability on some other dialogs.
Comment 8 vszocs 2012-09-05 10:45:32 EDT
I'm able to reproduce both issues as reported by Itamar.

Issue #1 - caused by the actual table (AbstractActionTable.table field) not filling up remaining space ("empty area") vertically. This could be fixed with CSS.

Issue #2 - able to reproduce it also in Users main grid. Will investigate and compare with Shahar's patch.
Comment 9 vszocs 2012-09-05 10:47:59 EDT
Exact steps to reproduce issue #2: click outside Users tab, then click Users tab, first right-click on *each* row will produce browser-default context-menu, instead of application context-menu.
Comment 10 vszocs 2012-09-05 10:54:32 EDT
There are two methods related to table context-menu:

1. AbstractActionPanel.addContextMenuHandler() for "contextmenu" JS event, which might not be called for first right-click (not sure why)
2. AbstractActionTable.table cell preview handler (AbstractActionTable:261) that is always called, and takes care of selecting given row, for "mousedown" (right button) JS event

A quick fix would be to move logic from method 1. to method 2. for AbstractActionTable, as the second method is always called. Need to investigate why the 1st one is not called sometimes on first right-click.
Comment 11 vszocs 2012-09-05 12:44:24 EDT
Seems that before a row is selected through table selection model, it doesn't receive "contextmenu" JS events (method 1. above is not called). That's the reason why the row gets selected (method 2. above), but without application context-menu being shown (method 1. above).

IIUC this might indicate that row selection involes some additional DOM operations on the selected row. This also indicates that this issue is related to HasData widgets (e.g. CellTable within AbstractActionTable) only.

Suggested solution: use CellPreviewEvent/mousedown, in favor of ContextMenuEvent/contextmenu, for HasData widgets. If this works, I'll update the patch for review.
Comment 12 vszocs 2012-09-06 08:16:26 EDT
Issue #2 fixed, issue #1 shouldn't take too long, I'll update the patch shortly after that.
Comment 13 vszocs 2012-09-06 08:25:57 EDT
Working solution based on "contextmenu" event after all, "mousedown" is not reliable/consistent accross different browsers/platforms.

For example, FF/Win opens context menu AFTER releasing mouse button, FF/Linux opens context menu BEFORE releasing mouse button.
Comment 14 vszocs 2012-09-06 09:30:23 EDT
New patch for both issues submitted upstream: http://gerrit.ovirt.org/7820

Shahar, can you please review/verify?
Comment 15 Shahar Havivi 2012-09-06 10:07:04 EDT
(In reply to comment #14)
> New patch for both issues submitted upstream: http://gerrit.ovirt.org/7820
> 
> Shahar, can you please review/verify?
Yes its working fine,
Thanks for your help!
Comment 16 vszocs 2012-09-06 10:16:37 EDT
You are welcome, thanks for your quick response. Daniel/Shahar, can you also review the code?

(Shahar, if you agree, we could merge gerrit#7820 upstream/downstream, in favor of the original patch gerrit#7716)
Comment 17 Shahar Havivi 2012-09-06 10:47:29 EDT
(In reply to comment #16)
> You are welcome, thanks for your quick response. Daniel/Shahar, can you also
> review the code?
just +1 (forgot when I verify it...)

> 
> (Shahar, if you agree, we could merge gerrit#7820 upstream/downstream, in
> favor of the original patch gerrit#7716)
fine with me
Comment 18 vszocs 2012-09-06 10:55:41 EDT
Thank you Shahar.

Itamar/Yaniv/Einav, can you please give acks (+) if this is to be included in 3.1.0?
Comment 19 vszocs 2012-09-10 05:57:43 EDT
Patch merged upstream: http://gerrit.ovirt.org/7820
Comment 20 vszocs 2012-09-10 06:01:32 EDT
Patch submitted downstream: https://gerrit.eng.lab.tlv.redhat.com/1989
Comment 21 vszocs 2012-09-10 08:39:16 EDT
Patch merged downstream
Comment 22 Einav Cohen 2012-09-12 10:51:48 EDT
(In reply to comment #1)
> 1. right clicking on "empty" areas of the grid - always reproduces the issue.

This one is solved.

> 2. right clicking on a 'host' quickly after selecting the hosts tab will
> also reproduce this issue, even though the host is selected.
> (I'd attach a screenshot, but hitting print-screen causes the context menu
> to disapper...)

This one is trickier and less interesting, I think. If critical, open a separate BZ (not sure will be fixed for 3.1 though).
Comment 23 Einav Cohen 2012-09-12 11:07:12 EDT
For QA: Note that the browser's default context menu is still being opened in some scenarios (e.g. clicking in the "General" sub-tab area), which is fine since it is critical for tasks such as "copy (to clipboard)").
Comment 24 vszocs 2012-09-12 12:04:20 EDT
> 2. right clicking on a 'host' quickly after selecting the hosts tab will
> also reproduce this issue, even though the host is selected.
> (I'd attach a screenshot, but hitting print-screen causes the context menu
> to disapper...)

Did anyone try to reproduce this issue, is it still relevant? (I wasn't able to reproduce it after applying above mentioned patch.)
Comment 25 Pavel Stehlik 2012-09-14 08:08:04 EDT
Created attachment 612827 [details]
right-click

Worth a thousand words - see the att. video.
I's still the same as Itamar reported. FF15, F17.

Repro:
Left click on the VM tab, then right click on VM row. Each 1st attempt shows FF menu instead RHEVM.
Comment 26 Einav Cohen 2012-09-25 01:39:18 EDT
(In reply to comment #25)
> Created attachment 612827 [details]
> right-click
> 
> Worth a thousand words - see the att. video.
> I's still the same as Itamar reported. FF15, F17.
> 
> Repro:
> Left click on the VM tab, then right click on VM row. Each 1st attempt shows
> FF menu instead RHEVM.

Vojtech - I also managed to reproduce it (on latest downstream) - you have to left-click an item, and *really quickly* afterwards right-click it ("really quickly": like double-click, only with different mouse buttons...).
I am using FF12 on F16.

I am moving this to ON_QA, as this bug is actually solved as of si18. 
QA: Comment #22 needs to be taken into consideration when verifying - scenario 2 is not solved. Please attempt to verify only scenario 1. 
Also look in Comment #23.

Note You need to log in before you can comment on or make changes to this bug.