JavaScript confirm() dialog always returns true if operated with keyboard

VERIFIED DUPLICATE of bug 67923

Status

SeaMonkey
UI Design
VERIFIED DUPLICATE of bug 67923
18 years ago
10 years ago

People

(Reporter: jsp, Assigned: Blake Ross)

Tracking

({dataloss})

Trunk
dataloss

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

990 bytes, text/html
Details
(Reporter)

Description

18 years ago
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; m18) Gecko/20010208
BuildID:    2001020804

If you use the keyboard (tab and enter keys) rather than a pointer to operate
the JavaScript confirm() dialog, confirm() always returns true, regardless of
whether OK or Cancel is selected.

Reproducible: Always
Steps to Reproduce:
Load the attached test case.
Click the text of the first paragraph to bring up a confirm() dialog.
Use the tab key to select the Cancel button, then press Enter to dismiss the dialog.
Note the return value displayed in the alert() dialog that pops up.

Actual Results:  true is returned.

Expected Results:  false should be returned (as it is if you use a pointer to
click Cancel).

Also occurs on Macintosh build 2001020208.
(Reporter)

Comment 1

18 years ago
Created attachment 25147 [details]
Test case.

Comment 2

18 years ago
I'm seeing this on linux-2001013010 as well. However, if I tab to the cancel
button and then press "Space" instead of "Enter", 
the cancel button ispressed and it returns false as  expected. Seems to be just
a problem with the enter key...
(Reporter)

Comment 3

18 years ago
Space also behaves the way Enter should on Windows and Macintosh.

Comment 4

18 years ago
Confirming bug because I see it on 2001021204 WinNT build.

Correct behavior of the buttons for Windows is that space and Enter should
activate the currently selected button. The confirm dialog incorrectly assumes
that Enter always maps to the OK button. Space behaves the way Enter should.
Status: UNCONFIRMED → NEW
Ever confirmed: true

Comment 5

18 years ago
Added keywords 4xp (doesn't occur with Nav4/IE4+), dataloss because confirm
dialogs are often used before harmful actions in web applications and having
cancel fail to return false could cause problems, and proposed for mozilla0.9
milestone.
Keywords: 4xp, dataloss, mozilla0.9

Comment 6

18 years ago
This behavior of Enter not activating the currently selected button seems to
occur throughout Mozilla. I reproduced it with the Edit->Preferences dialog.
Therefore, I'm sure this bug is a duplicate, but can't find one that is general
enough. I'm looking for a bug like "Enter does not activate currently selected
button" 

Comment 7

18 years ago
let's accuse blake of knowing.
Assignee: asa → blakeross
Component: Browser-General → XP Apps: GUI Features
QA Contact: doronr → sairuh

Comment 8

18 years ago
Looks like the best duplicate is bug 67923 (cancel button alert cannot be
accessed via keyboard navigation).
(Assignee)

Comment 9

18 years ago
This is a dup of a bug that deals with enter not triggering the right button.  
Matthew, do you know the best bug to dup this against (I found a couple of 
candidates)?

Comment 10

18 years ago
tpowell is correct.

*** This bug has been marked as a duplicate of 67923 ***
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → DUPLICATE

Comment 11

18 years ago
vrfy dupe of bug 67923 cancel button alert cannot be accessed via keyboard 
navigation
Status: RESOLVED → VERIFIED
Product: Core → Mozilla Application Suite

Updated

10 years ago
Component: XP Apps: GUI Features → UI Design
You need to log in before you can comment on or make changes to this bug.