firefox no longer supports modifying "selected" attribute via javascript/jquery

RESOLVED WORKSFORME

Status

()

RESOLVED WORKSFORME
7 years ago
3 years ago

People

(Reporter: jshado_1, Unassigned, NeedInfo)

Tracking

8 Branch
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

7 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:9.0.1) Gecko/20100101 Firefox/9.0.1
Build ID: 20111220165912

Steps to reproduce:

Previous to Ffx8, the following pair worked fine:
$("select > option:first").attr("selected","selected");
$("select > option:first").removeAttr("selected");


Actual results:

The select element gets stuck on the first option: the actual code selected="selected" is removed, yet if you select a different option, it doesn't change. You (as a user) have to manually select the first option, then go back and select whichever one you want. If you don't manually select the first option first, you cannot select a different option.


Expected results:

After removing the "selected" attribute, the select element should behave as if there was no hard-coded selected="selected".

Here is an example of the issue: http://jsfiddle.net/jshado1/EkDdB/
Click the button "click to fade in"
Try to select any option but the first
(Reporter)

Updated

7 years ago
(Reporter)

Comment 1

7 years ago
I have tested this in Ffx 4 thru 9.0.1 on Mac and Win, and the issue first appears in Ffx8 (and continues thru v9.0.1).

This issue is isolated to Firefox (tested in Safari/Chrome and Opera for Mac & Win, and IE on Win).
(Reporter)

Updated

7 years ago
Summary: firefox no longer supports attribute "selected" via javascript/jquery → firefox no longer supports modifying "selected" attribute via javascript/jquery
This appears to work fine now in Firefox 19. Jacob, thanks for reporting it and I'm sorry that this issue didn't get a response earlier.  But, at least appears to be fixed now!
Status: UNCONFIRMED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → WORKSFORME

Comment 3

3 years ago
I'm having the same problem in 40.0a2 version (24/06/2015), some of you are acotecendo this error?
Flags: needinfo?(jshado_1)
You need to log in before you can comment on or make changes to this bug.