Closed Bug 6928 Opened 26 years ago Closed 26 years ago

[BLOCKING WALLET] Deleting items in a SELECT list doesn't work

Categories

(Core :: Layout, defect, P3)

x86
Windows NT
defect

Tracking

()

VERIFIED DUPLICATE of bug 3187

People

(Reporter: morse, Assigned: pollmann)

References

()

Details

The following content displays a list and a button labeled "remove". Selecting an entry in the list and pressing the "remove" button should result in the entry being removed from the screen-display of the list. This is exactly what happens in the 4.x browser. In seamonkey, nothing happens when the button is pressed. <HTML> <HEAD> <SCRIPT> list_frame = 0; button_frame = 1; function DeleteSignonSelected() { selname = top.frames[list_frame].document.fSelectSignon.selname; var p; var i; for (i=selname.options.length; i>0; i--) { if (selname.options[i-1].selected) { selname.options[i-1].selected = 0; for (j=i ; j<selname.options.length ; j++) { selname.options[j-1] = selname.options[j]; } selname.options[selname.options.length-1] = null; } } } function loadSignons(){ top.frames[list_frame].document.open(); top.frames[list_frame].document.write( "<FORM name=fSelectSignon>" + "<P>" + "<TABLE BORDER=0 WIDTH=100%HEIGHT=95%>" + "<TR>" + "<TD WIDTH=100%VALIGN=TOP>" + "<CENTER>" + "<P>" + "<SELECT NAME=selname SIZE=15 MULTIPLE> " + "<OPTION value=0>" + "scopus:abc" + "</OPTION>" + "<OPTION value=1>" + "scopus:jack" + "</OPTION>" + "</SELECT>" + "</CENTER>" + "</TD>" + "</TR>" + "</TABLE>" + "</FORM>" ); top.frames[list_frame].document.close(); } function loadButtons(){ top.frames[button_frame].document.open(); top.frames[button_frame].document.write( "<FORM name=buttons>" + "<INPUT type=BUTTON " + "value=Remove " + "onclick=\"top.DeleteSignonSelected()\">" + "</FORM>" ); top.frames[button_frame].document.close(); } function loadFrames(){ loadSignons(); loadButtons(); } </SCRIPT> </HEAD> <FRAMESET ROWS = *,25 onLoad=loadFrames()> <FRAME SRC=about:blank> <FRAME SRC=about:blank> </FRAMESET> <NOFRAMES> <BODY> <P> </BODY> </NOFRAMES> </HTML>
Assignee: rickg → kmcclusk
Kevin: please review this, but when I tested it it worked for me.
Status: NEW → ASSIGNED
Target Milestone: M7
Works with native widgets. Gfx-rendered listbox crashes when there aren't any items in the list.
Assignee: kmcclusk → pollmann
Status: ASSIGNED → NEW
Fixed problem with crashing in gfx-rendered listbox. gfx-rendered listbox displays as short line when empty. Filing a new bug for this. For both native and gfx listboxes both items are removed when the first item is selected and remove is click on. On NN 4.x and IE only the first item in the list is removed. This looks like a problem with accessing the select form element through the DOM. Eric, I am reassigning to you to investigate this problem when deleting items through the DOM.
Status: NEW → ASSIGNED
Looks like a dup of bug 3187 - incorrectly restoring selection information after an option is overwritten. This is a sticky DOM architectural issue and probably won't be fixed right away. Steve, to unblock you, deleting (not overwriting) currently works. I've put a mostly working rewrite of your code up at http://blueviper/forms/addoption4.html This is the changed delete function: function DeleteSignonSelected() { selname = top.frames[list_frame].document.fSelectSignon.selname; var p; var i; for (i=selname.options.length; i>0; i--) { if (selname.options[i-1].selected) { selname.remove(i-1); } } } (not backwards compatible with Nav)
Blocks: 7530
Work-around presented here is more than adequate for my needs -- it is actually preferable than the way I was doing things. Thanks Eric. I no longer have an interest in this bug.
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → DUPLICATE
Since the only remaining issue in this bug is reported in bug 3187, marking it a dup. *** This bug has been marked as a duplicate of 3187 ***
Status: RESOLVED → VERIFIED
Agrred. This is a duplicate of 3187.
You need to log in before you can comment on or make changes to this bug.