Closed Bug 297172 Opened 20 years ago Closed 19 years ago

[FIX]Select box bug when dynamicly enabling and disabling multiple selects.

Categories

(Core :: Layout: Form Controls, defect, P3)

x86
All
defect

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: jeppe.dyrby, Assigned: bzbarsky)

Details

(Keywords: testcase)

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050527 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050527 Firefox/1.0+

When dynamicly changing the state of a select box (<select>) with javascript
from a list with multiple selections, to a single selection dropdown box, the
selected items (multiple) are still selected when the box drops down. When the
mouse hovers over some elements, they seese to be selected.
I believe this is a bug, because it should not be possible to have multiple
selections in a dropdown box. It should, if at all, only be the first option
that would be selected if such a change should happend.

This was in Deer Park Alpha 1, not tested in other versions, or on other
platforms. An example shall be made ASAP.

Reproducible: Always

Steps to Reproduce:
1. Make select box with multiple selections.
2. Change the state with javascript, while having selected multiple options.
3. Select the box, to make it drop down, see what happends.

Actual Results:  
The multiple selections from the list, wich allows this, is transferred to the
single selection dropdown box.

Expected Results:  
Only one should have been selected.

An example page will be made ASAP.
Example page.
Mail me if this page for some unknown reason disapears.

http://bravoo.dk/playground/bug297172.html
Keywords: testcase
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050609
Firefox/1.0+ ID:2005060918

WFM. The selected items are retained no matter how many times you check "change
select box" and no matter how many items you have selected in the dropdown menu.
Status: UNCONFIRMED → NEW
Component: General → Layout: Form Controls
Ever confirmed: true
OS: Windows XP → All
Product: Firefox → Core
QA Contact: general → layout.form-controls
Version: unspecified → Other Branch
Version: Other Branch → Trunk
Attached patch Proposed patchSplinter Review
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #197270 - Flags: superreview?(peterv)
Attachment #197270 - Flags: review?(peterv)
Priority: -- → P3
Summary: Select box bug when dynamicly enabling and disabling multiple selects. → [FIX]Select box bug when dynamicly enabling and disabling multiple selects.
Target Milestone: --- → mozilla1.9alpha
Comment on attachment 197270 [details] [diff] [review]
Proposed patch

>Index: content/html/content/src/nsHTMLSelectElement.cpp
>===================================================================

>+    PRInt32 selectedIndex;
>+    GetSelectedIndex(&selectedIndex);
>+    if (selectedIndex > -1) {

Any reason to not use mSelectedIndex?
Attachment #197270 - Flags: superreview?(peterv)
Attachment #197270 - Flags: superreview+
Attachment #197270 - Flags: review?(peterv)
Attachment #197270 - Flags: review+
Fixed on trunk.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: