Closed Bug 404944 Opened 17 years ago Closed 17 years ago

form control lose focus after alert()

Categories

(Core :: DOM: Core & HTML, defect)

1.8 Branch
x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: kes-kes, Unassigned)

References

()

Details

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
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
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();"> ?
URL you supply is worked, by mine code do not (
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → INVALID
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.