setting focus to item that WAS disabled works erratically



14 years ago
13 years ago


(Reporter: Tony Austin, Unassigned)


Firefox Tracking Flags

(Not tracked)




(1 attachment)



14 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040319
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040319

Attempting to set focus with Input.focus() on a field that has just been enabled
with Element.removeAttribute("disabled") works on alternating calls to the
routine.  ie. works, doesn't work, works, doesn't work - where I mean by
"doesn't work" that there is no cursor visible in the input field.  

Some apparently redundant code seems to workaround the problem.

Reproducible: Always
Steps to Reproduce:
function ins_Record() {
//  getId("ccy-desc").focus();
//  getId("ccy-code").focus();
  getId("ccy-code").value = "";
  getId("ccy-desc").value = "";
  getId("ccy-curr-rate").value = "";
  getId("ccy-std-rate").value = "";
  getId("ccy-alt-rate").value = "";
  getId("ccy-delete").checked = false;

function ccy_Cancel() {
  var d = gl_ccy_file_arr[gl_ccy_file_pos];
function show_Record(code) {
  getId("ccy-code").setAttribute("disabled", "true");
  getId("ccy-code").value = Ccy_file[code].code;
  getId("ccy-desc").value = Ccy_file[code].desc;
  getId("ccy-curr-rate").value = Ccy_file[code].curr_rate;
  getId("ccy-std-rate").value = Ccy_file[code].std_rate;
  getId("ccy-alt-rate").value = Ccy_file[code].alt_rate;
  getId("ccy-delete").checked = false;

Actual Results:  
Alternating calls to ins_record() and ccy_Cancel() give alternating success in
setting focus on ccy-code.

 Uncommenting two lines in ins_Record() allow the code to work correctly.

Expected Results:  
Focus should set every time without resorting to redundant lines of code.
Please attach an actual HTML file (using that could
be used to test this.

Comment 2

14 years ago
> User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040319

This bug looks like a dup of bug 235294 which is fixed in recent releases.

Comment 3

14 years ago
Created attachment 147604 [details]
complete source code for XUL application as .tgz

the area where the bug resides is in file content/pacs.js and is identified by
a comment containing the string mozilla-bug-242455

Comment 4

14 years ago
... continuing from previous comment:

This is not the same as fixed bug 235294 which is cured in Mozilla 1.7b; the bug
that I am reporting is not fixed in 1.7b.

I have added a URL where the bug can be seen in action, just press F8 and ESC
alternately and watch the cursor.

I have also created an attachment which has the complete source code for the XUL
application, as per previous comment.  I'm sorry, I can't strip it down to just
a few lines at present, but if this should prove essential I will have a go.

Comment 5

14 years ago
I see this on LInux 2004061405
Product: Browser → Seamonkey
This is an automated message, with ID "auto-resolve01".

This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.

While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.

If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.

The latest beta releases can be obtained from:
This bug has been automatically resolved after a period of inactivity (see above
comment). If anyone thinks this is incorrect, they should feel free to reopen it.
Last Resolved: 13 years ago
Resolution: --- → EXPIRED
You need to log in before you can comment on or make changes to this bug.