Closed Bug 68675 Opened 25 years ago Closed 25 years ago

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

Categories

(SeaMonkey :: UI Design, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED DUPLICATE of bug 67923

People

(Reporter: jsp, Assigned: bugzilla)

References

()

Details

(Keywords: dataloss)

Attachments

(1 file)

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.
Attached file Test case. —
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...
Space also behaves the way Enter should on Windows and Macintosh.
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.
URL: javascript:alert('Confirm returned '+...
Status: UNCONFIRMED → NEW
Ever confirmed: true
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
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"
let's accuse blake of knowing.
Assignee: asa → blakeross
Component: Browser-General → XP Apps: GUI Features
QA Contact: doronr → sairuh
Looks like the best duplicate is bug 67923 (cancel button alert cannot be accessed via keyboard navigation).
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)?
tpowell is correct. *** This bug has been marked as a duplicate of 67923 ***
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → DUPLICATE
vrfy dupe of bug 67923 cancel button alert cannot be accessed via keyboard navigation
Status: RESOLVED → VERIFIED
Product: Core → Mozilla Application Suite
Component: XP Apps: GUI Features → UI Design
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: