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

VERIFIED WORKSFORME

Status

Camino Graveyard
HTML Form Controls
VERIFIED WORKSFORME
9 years ago
9 years ago

People

(Reporter: Owen Saxton, Unassigned)

Tracking

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

9 years ago
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.
(Reporter)

Comment 1

9 years ago
Created attachment 352399 [details]
Test case that evokes the problem.

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.

Updated

9 years ago
Attachment #352399 - Attachment mime type: text/plain → text/html

Updated

9 years ago

Comment 2

9 years ago
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
(Reporter)

Comment 4

9 years ago
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.

Updated

9 years ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → WORKSFORME

Updated

9 years ago
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.