Handling ctrl + enter event using onkeydown event opens the firefox download manager box

RESOLVED WORKSFORME

Status

()

Firefox
General
RESOLVED WORKSFORME
9 years ago
7 years ago

People

(Reporter: Dinesh Ganti, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [CLOSEME 2010-11-01])

(Reporter)

Description

9 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3

I have added onkeydown event to a text area. Now, in my javascript function, i check if the keycode is 13 (which is for enter).  If this is true, i proceed to complete some other business logic specific to my page.

In the code as soon as the line if(keyCode == 13) is executed and execution enters the code block inside if block,  the downloads box is opened.

Iam pasting the sample page (html+js code) to demonstrate this.

Just press Enter in the text area and the downloads box will popup.

Code:

{{{
<html >
<head>
    <title>Untitled Page</title>
    <script type="text/javascript" language="javascript">
    
    function keydownFunc(e)
    {   
            var keyCodeVal = (document.all) ? window.event.keyCode : e.which;
            if (keyCodeVal  == 13)
            //Using any other code here for comparision WILL NOT throw the downloads box.
            {
                test();
            }
            
     }
     function test()
     {
        alert("ok");
     }
    </script>
</head>
<body >
<textarea onkeydown="keydownFunc(event);">
</textarea>
</body>
</html>

}}}


Please look into this.

Thanks in advance.

Reproducible: Always

Steps to Reproduce:
1. Create a simple html page with a text area and attach an onkeydown function to the text area.
2. In the js function check for keyCode == 13 and try to do something within the function
3. Now go to the text area and hit ctrl + enter
Actual Results:  
Downloads box is shown when ctrl+enter is hit in the text area

Expected Results:  
Downloads box is not shown in such case.
(Reporter)

Comment 1

9 years ago
(In reply to comment #0)
> User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3)
> Gecko/2008092417 Firefox/3.0.3
> Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3)
> Gecko/2008092417 Firefox/3.0.3
> I have added onkeydown event to a text area. Now, in my javascript function, i
> check if the keycode is 13 (which is for enter).  If this is true, i proceed to
> complete some other business logic specific to my page.
> In the code as soon as the line if(keyCode == 13) is executed and execution
> enters the code block inside if block,  the downloads box is opened.
> Iam pasting the sample page (html+js code) to demonstrate this.
> Just press Enter in the text area and the downloads box will popup.
> Code:
> {{{
> <html >
> <head>
>     <title>Untitled Page</title>
>     <script type="text/javascript" language="javascript">
>     function keydownFunc(e)
>     {   
>             var keyCodeVal = (document.all) ? window.event.keyCode : e.which;
>             if (keyCodeVal  == 13)
>             //Using any other code here for comparision WILL NOT throw the
> downloads box.
>             {
>                 test();
>             }
>      }
>      function test()
>      {
>         alert("ok");
>      }
>     </script>
> </head>
> <body >
> <textarea onkeydown="keydownFunc(event);">
> </textarea>
> </body>
> </html>
> }}}
> Please look into this.
> Thanks in advance.
> Reproducible: Always
> Steps to Reproduce:
> 1. Create a simple html page with a text area and attach an onkeydown function
> to the text area.
> 2. In the js function check for keyCode == 13 and try to do something within
> the function
> 3. Now go to the text area and hit ctrl + enter
> Actual Results:  
> Downloads box is shown when ctrl+enter is hit in the text area
> Expected Results:  
> Downloads box is not shown in such case.




I just noticed that his happens for every input control like textbox, select etc and not just for text areas.

Please look into this.

Thanks,
Dinesh
This is a mass search for bugs which are in the Firefox General component, are
UNCO, have not been changed for 500 days and have an unspecified version. 

Reporter, can you please update to Firefox 3.6.10 or later, create a fresh profile, http://support.mozilla.com/en-US/kb/managing+profiles, and test again. If you still see the issue, please update this bug. If the issue is gone, please set the status to RESOLVED > WORKSFORME.
Whiteboard: [CLOSEME 2010-11-01]
(Reporter)

Comment 3

7 years ago
This is no longer a issue in the new Firefox version 3.6.8 which iam using.

This is good to close.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.