Closed Bug 101841 Opened 23 years ago Closed 23 years ago

Right mouse click creates mouse click even for javascript

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

x86
Windows NT
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 71705

People

(Reporter: mattl, Assigned: joki)

Details

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:0.9.4) Gecko/20010913
BuildID:    2001091303

Seems stupid and open for interpretation but I think that the right mouse button
should be treated as a separate and distinct event from the left button event. 
As it stands now, if the script has a click event trigger, it triggers for the
right button as well as the right but NOT when the right mouse button is clicked
away from the triggering point, ie. the user right-clicks somewhere else in the
browser to generate a right-click menu and THEN click the right mouse button in
the area of the window that has the offending script.

Reproducible: Always
Steps to Reproduce:
1.Go to a page where there is a mouse-click generated event (the one I have is
behind a company firewall, sorry) for the default button (left button) but
expects a pop-up right-click menu for the right mouse button.
2.Right click there.
3.The event triggered is the same for both left and right mouse buttons.
4.Right click away from the event area.
5.With the right-click pop-up still open and visible on-screen, right click in
the area and now the event is NOT triggered.

Actual Results:  The left and right mouse buttons are considered the same except
when the right mouse button is used away from the event area.

Expected Results:  I would prefer that the left and right mouse buttons be
considered different events. 

I am not a programmer but I ripped the offending script (I hope) from the page
in question.  What should happen is the user left clicks on the link and gets a
pop-up window instructing the user to use the right mouse button on that link. 
Instead in Mozilla .9.4, the user can either left or right click and get a
pop-up window instructing to use the right mouse button.  All versions of IE and
previous versions of Netscape treat the left button as a separate event.

<script LANGUAGE="JavaScript">
<!--//Hide this script from imcompatible browsers!

function showInstructions()
{
	alert("Please follow the steps at right to download your image.");
	return false;
}

function showStatus() { window.status='Download file'; return true; }

var px=navigator.userAgent.toLowerCase();  //lowercase makes it easier to test

var step1 = "";
var mouseAction = "";
mac = (px.indexOf('mac') != -1);

mouseAction = (mac) ?  "Click and hold" : "Right-click";
step1 += "<B><font color=\"Black\">" +mouseAction+ "</FONT></B> on the
\"DOWNLOAD NOW\" link below.";

var step2 = "Select ";

if (document.all)
	step2 += (!mac) ? "<B><font color=#000000>\"Save Target As...\"</FONT></B>" :
"<B><font color=#000000>\"Download Link to disk\"</FONT></B>";
else 
	step2 += (!mac) ? "<B><font color=#000000>\"Save Link As...\"</FONT></B>" :
"<B><font color=#000000>\"Save this Link as...\"</FONT></B>";

// end hide -->
</SCRIPT>
See also bug 30878, bug 86468.

This sounds like bug 71705 which is from the onclick handler.  You didn't
provide the full HTML but inferring from your description it makes sense in this
context.  Duping.  Please reopen if you disagree.

*** This bug has been marked as a duplicate of 71705 ***
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
QA Contact: madhur → rakeshmishra
QA Contact: rakeshmishra → trix
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.