form control lose focus after alert()

RESOLVED INVALID

Status

()

Core
DOM
RESOLVED INVALID
11 years ago
11 years ago

People

(Reporter: Eugen Konkov, Unassigned)

Tracking

1.8 Branch
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9

You are in <input type="text"> for example. If you alert() something by JavaScript  after 'OK' you will see that your 'input' have lost focus

Reproducible: Always

Steps to Reproduce:
<input id="aaa" type="text"><input type = "button" onClick="checkInput">
function checkInput(){
 var elem= getElementById( "aaa" );
 if( elem.innerHTML != "sometext" ) {
   elem.focus();
   alert('bla-bla-bla');
   //or you can raise an exception: 
   //throw 'bla-bla-bla';
   }
}

In both cases an element 'aaa' will not be focused =(


Expected Results:  
   elem.focus();
   alert('bla-bla-bla');

element 'elem' must not lose focus

Comment 1

11 years ago
WFM

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9b1) Gecko/2007110903 Firefox/3.0b1
Component: General → DOM
Product: Firefox → Core
QA Contact: general → general
Version: unspecified → 1.8 Branch

Comment 2

11 years ago
Can you reproduce using this URL:
data:text/html,<script>function%20f(){var%20e=document.getElementById("a");e.focus();alert("foo");}</script><input%20id="a"%20type="text"><input%20type="button"%20onClick="f();"> ?
(Reporter)

Comment 3

11 years ago
URL you supply is worked, by mine code do not (
Status: UNCONFIRMED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.