Closed
Bug 6928
Opened 25 years ago
Closed 25 years ago
[BLOCKING WALLET] Deleting items in a SELECT list doesn't work
Categories
(Core :: Layout, defect, P3)
Tracking
()
M7
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>
Updated•25 years ago
|
Status: NEW → ASSIGNED
Target Milestone: M7
Comment 2•25 years ago
|
||
Works with native widgets. Gfx-rendered listbox crashes when there aren't any
items in the list.
Updated•25 years ago
|
Assignee: kmcclusk → pollmann
Status: ASSIGNED → NEW
Comment 3•25 years ago
|
||
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.
Assignee | ||
Updated•25 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 4•25 years ago
|
||
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)
Reporter | ||
Comment 5•25 years ago
|
||
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.
Assignee | ||
Updated•25 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → DUPLICATE
Assignee | ||
Comment 6•25 years ago
|
||
Updated•25 years ago
|
Status: RESOLVED → VERIFIED
Comment 7•25 years ago
|
||
Agrred. This is a duplicate of 3187.
You need to log in
before you can comment on or make changes to this bug.
Description
•