Closed
Bug 100297
Opened 24 years ago
Closed 24 years ago
Mouse clicking of text entry fields disabled by javascript intended to disable the context menu
Categories
(SeaMonkey :: General, defect)
Tracking
(Not tracked)
RESOLVED
INVALID
People
(Reporter: William.Noad, Assigned: asa)
Details
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) Gecko/20010913
BuildID: 2001091311
We are developing a web based application that has to run with the toolbar and
context menu disabled. When we do this our text entry fields cannot be selected
with the mouse.
This is the Javascript used to disable the menu:
document.oncontextmenu = function(){return false}
if(document.layers) {
window.captureEvents(Event.MOUSEDOWN);
window.onmousedown = function(e){
if(e.target==document)return false;
}
} else {
document.onmousedown = function(){return false}
}
Is this symptomatic of non-standard Javascript use?
Reproducible: Always
Steps to Reproduce:
Put this HTML into a file (sorry, no webspace):
<HTML><HEAD>
<SCRIPT language="javascript">
document.oncontextmenu = function(){return false}
if(document.layers) {
window.captureEvents(Event.MOUSEDOWN);
window.onmousedown = function(e){
if(e.target==document)return false;
}
} else {
document.onmousedown = function(){return false}
}
</SCRIPT> </HEAD>
<BODY><FORM><input type="text" name="text" value="Some Text"></FORM></BODY>
</HTML>
When rendered by Mozilla, you cannot select the text field with the mouse.
Actual Results: When rendered by Mozilla, you cannot select the text field with
the mouse.
Expected Results: I expected Mozilla to disable the context menu only.
I'm not a javascript programmer, I'm using some boilerplate supplied by a third
party.
Any suggestions?
![]() |
||
Comment 1•24 years ago
|
||
> document.oncontextmenu = function(){return false}
This will disable the context menu in mozilla
> } else {
> document.onmousedown = function(){return false}
> }
That will disable onmousedown, which means it will disable selecting form fields
(such seletion happens onmousedown, no?)
If you feel that you want to disable the mousedown event to disable context
menus in some other browser, please put some more conditioning in there so
Mozilla does not get onmousedown disabled.
Status: UNCONFIRMED → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
Updated•20 years ago
|
Product: Browser → Seamonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•