Top select box does not visually display the selected value

RESOLVED WORKSFORME

Status

()

Core
Layout: Form Controls
RESOLVED WORKSFORME
9 years ago
3 years ago

People

(Reporter: Jayden, Unassigned)

Tracking

27 Branch
All
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Reporter)

Description

9 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)

Using javascript I am manipulating the location of tbody elements in a table.  After manipulating the position of these tbody elements I go through and change the order number in the select box in each tbody.  Everything seems to work correctly unless you move the select boxes in a certain order on my test case.

Reproducible: Always

Steps to Reproduce:
1. Click the Third select box and change it to 2.  The Third will change to 2 and the Second will change to 3. (correct behavior)  
2. Click what was the Third select box (now Second) and change it to 1.  The Third will change to 1 and the First will change to 1.  In the source the First has changed to 2 but it is still displaying 1.  (incorrect behavior)
3. Shift Refresh the page and change the First to 2.  The First will change to 2 and the Second will change to 1.  (correct behavior)
4. Change the First to 1.  The First will change to 1 and the Second will change to 2.  (correct behavior)
5. Now if you repeat steps 1, 2, and 3 everything will work as expected (correct behavior)
Actual Results:  
If you start by moving the 2nd or 3rd boxes into the 1st position the 1st elements selected value will change but the displayed value will not.  If you move the 1st box at all everything will work correctly no matter what you move after you have touched it.

Expected Results:  
The 1st box should display the selected value when it is changed.

If you put an alert before and after these 2 lines:
          reorderSelect.options[y].defaultSelected = true;
          reorderSelect.options[y].selected = true;
you will see the value for the 1st box quickly change to the correct selected value but it then quickly changes back to the original value of 1.

I have attached an image as well as the test case.  In the image I moved the 3rd box to the 1st position and then moved the 2nd box to the 1st position.  I then brought up the selected source.  In the source part of the image I highlighted a character beside each number (2, 3, 1) and if you look at the select box for these the select box for 1 says that 3 is selected but 1 is being displayed.
(Reporter)

Comment 1

9 years ago
Created attachment 376155 [details]
Test Case
(Reporter)

Comment 2

9 years ago
Created attachment 376156 [details]
Display of the select boxes and selected source

In this case I have moved the 3rd box to position 1 and then the 2nd box to position 1.
(Reporter)

Updated

9 years ago
Version: unspecified → 3.0 Branch
(Reporter)

Comment 3

9 years ago
I have not tested this with a different doctype so I don't know if it will act the same.
Component: General → Layout: Form Controls
Product: Firefox → Core
QA Contact: general → layout.form-controls
Version: 3.0 Branch → 1.9.0 Branch
(Reporter)

Comment 4

9 years ago
Tested in the Firefox 3.5 nightlies with the same effect.
Would be nice to have a minimal-ish testcase (smallest possible amout of JS that still shows the problem).

Mats, do you want to take a look at this?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: qawanted
(Reporter)

Comment 6

9 years ago
I'll try to make a smaller testcase this weekend.  I didn't have time that that night to do so.
The  bug is still reproducible on FF 27 build id 20140109165205.
OS: Windows XP → Windows 7
Hardware: x86 → All
Version: 1.9.0 Branch → 27 Branch
Created attachment 8360936 [details]
testsimplified.html

Somehow simplified test case as easily to reproduce issue:

STR

1. Open the attached page.(Paul should be "first place" and John should be second place)
2. Set John as first place.

Expected:
John is set as first place and Paul is set as second place.

Actual:
Both places remain "first place" .
Keywords: qawanted
(Reporter)

Comment 9

3 years ago
This bug no longer seems to exist in 40.  Must have been fixed somewhere along the line.
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.