Closed Bug 468985 Opened 16 years ago Closed 16 years ago

Javascript-directed focus on a submit button doesn't work when keyboard shortcut used

Categories

(Camino Graveyard :: HTML Form Controls, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED WORKSFORME

People

(Reporter: ohsaxton, Unassigned)

References

()

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en; rv:1.8.1.18) Gecko/20081112 Camino/1.6.5 (like Firefox/2.0.0.18)
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en; rv:1.8.1.18) Gecko/20081112 Camino/1.6.5 (like Firefox/2.0.0.18)

I'm running a web server generating pages dynamically.  Most of these pages contain Javascript code that puts the focus on an update (submit) button, so that the page can be updated just by pressing the Return key.  But if I use the Return key to do this, the updated page no longer has focus on the update button.  Clicking on the update button or generating the page via a link correctly leaves the focus on the update button.  One page also has access keys defined for several buttons, and if any of these is used to refresh the page, the update button no longer receives focus.  Other browsers such as Firefox and Safari work correctly.

Reproducible: Always

Steps to Reproduce:
1. Go to web page (on private server) containing update button
2. Press Return key 
3.
Actual Results:  
Page is updated, but the update button doesn't have focus.

Expected Results:  
Page is updated, and the update button has focus.
The original problem occurs in dynamic pages generated by a private server.  This file is a portion of such a generated page, modified to remove focus and reload the page when the button is clicked, instead of submitting the form.  It doesn't display the problem every time, so it's looking like a timing issue.  Possibly the problem won't occur at all on a fast machine; mine's a dual 450 MHz G4.
Attachment #352399 - Attachment mime type: text/plain → text/html
I think you're probably right about it being a timing issue; I can't reproduce the problem at all with Camino 1.6.5, a trunk nightly, or Firefox 2 (or 3) on a 1.5 GHz PowerBook G4.
Owen, can you please check this in a Camino 2.0pre nightly build from http://ftp.mozilla.org/pub/mozilla.org/camino/nightly/latest-2.0-M1.9/ (you'll want to test with a fresh profile because the 2.0pre nightlies upgrade a profile in such a way that the profile can't be used with 1.6.x any more; http://pimpmycamino.com/parts/troubleshoot-camino can automate running with a fresh profile)?

It looks to me like it's fixed in the 2.0pre nightlies, but I'm also on a fast machine….
Component: General → HTML Form Controls
QA Contact: general → form.controls
It is indeed fixed in 2.0pre.  Thanks for the very fast response!

I found a sure-fire way to demonstrate the problem (or a closely related one) using the test file, even on a fast machine.  Just drag the file into a Camino window, and observe that the button doesn't have focus.  This also is fixed in 2.0pre.
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → WORKSFORME
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: