Closed Bug 77039 Opened 24 years ago Closed 23 years ago

[FIX]Setting selectedIndex on SELECT MULTIPLE does not clear existing selections

Categories

(Core :: DOM: Core & HTML, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla0.9.2

People

(Reporter: otto, Assigned: john)

References

Details

(Whiteboard: [FIX])

Attachments

(2 files)

According to the Netscape 4 docs, "Setting selectedIndex clears any other options that are selected in the Select object." Mozilla 0.8.1 (Win32) does not exhibit this behavior -- existing selections remain after selectedIndex is set.
Attached file Testcase (deleted) —
Rods, could you look into this?
Assignee: jst → rods
seeing this on linux build 2001-04-22-21 as well.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 2000 → All
Target Milestone: --- → mozilla1.0
Patch: Index: nsListControlFrame.cpp =================================================================== RCS file: /cvsroot/mozilla/layout/html/forms/src/nsListControlFrame.cpp,v retrieving revision 1.194 diff -u -r1.194 nsListControlFrame.cpp --- nsListControlFrame.cpp 2001/05/30 11:26:18 1.194 +++ nsListControlFrame.cpp 2001/05/30 14:43:55 @@ -2745,7 +2745,9 @@ } // if it is a multiple, select the new item if (multiple) { + Deselect(); SetOptionSelected(selectedIndex, PR_TRUE); + mSelectedIndex = selectedIndex; } else { // if it is a single select, // check to see if it is the currect selection
Status: NEW → ASSIGNED
Summary: Setting selectedIndex on SELECT MULTIPLE does not clear existing selections → [FIX]Setting selectedIndex on SELECT MULTIPLE does not clear existing selections
Whiteboard: Fix in Hand
Target Milestone: mozilla1.0 → mozilla0.9.2
sr=attinasi
a=dbaron for trunk checkin (on behalf of drivers)
Blocks: 83989
fixed
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
bug 148645 may cause a reopen.
*** Bug 148645 has been marked as a duplicate of this bug. ***
This seems to have regressed -- On RC3, setting selectedIndex on a SELECT MULTIPLE no longer clears the existing selection (as with Netscape 4 and IE). See testcase attachment.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
John, got any ideas on this bug?
I have a fix, reassigning so that I will find this bug again.
Assignee: rods → jkeiser
Status: REOPENED → NEW
Status: NEW → ASSIGNED
Attached patch Patch (deleted) — Splinter Review
I guess I missed that when I redid select last year. Here ya go.
IE6 works this way too, and it seems like reasonable behavior to me.
Whiteboard: Fix in Hand → [FIX]
Comment on attachment 86342 [details] [diff] [review] Patch r=rods
Attachment #86342 - Flags: review+
Comment on attachment 86342 [details] [diff] [review] Patch sr=jst
Attachment #86342 - Flags: superreview+
Fix checked in to trunk.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago23 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: