Calling element.blur() removes focus unconditionally, even when "element" doesn't have focus.

RESOLVED FIXED

Status

()

Firefox
Keyboard Navigation
RESOLVED FIXED
11 years ago
9 years ago

People

(Reporter: Tom Brown, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6

The element.blur() method seems to unconditionally cause focus to be lost. For example:

A.focus(); // Give element A focus.
B.blur(); // Ensure element B loses focus.

After running this, element "A" should retain focus, but no focus exists. This behavior is incorrect, as B.blur should only cause the blur to happen if element "B" has focus. Webkit and IE both allow this to work.

I have included as an attachment the HTML file I used to test this behavior.

Reproducible: Always

Steps to Reproduce:
1. (In javascript) focus element "A"
2. blur element "B"

Actual Results:  
Neither "B" nor "A" retain focus.

Expected Results:  
"A" should retain focus.
(Reporter)

Comment 1

11 years ago
Created attachment 281246 [details]
The HTML file used to test this functionality

Updated

9 years ago
Depends on: 178324

Comment 2

9 years ago
This bug should have been fixed by 178324.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.