Closed Bug 11010 Opened 21 years ago Closed 21 years ago

when I remove the last option element of a HTML select object, the text stays behind.

Categories

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

x86
Linux
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: sspitzer, Assigned: vidur)

Details

(Whiteboard: [TESTCASE])

Attachments

(1 file)

in the message compose window, we are using a html select widget to list the
attachments.

in the menu, we have a "remove last attachment".

if my select widget has 3 options, removing #3 works as expected:  two are left.
when I have 2 and remove the last 1, it works also.

when I remove 1 when I have 1, it works, but it "looks" like one is still left,
as the text of the last option element stays behind.

my current work around is, when I remove the last one, add a blank option, with
text = " ", and then remove it.
Whiteboard: MAKINGTEST mdubinko@yahoo.com
A quick test and I didn't see any problems. I will investigate further.
this test case exhibits the bug on Linux with today's build (8/2/99)
after I hit the "Remove all" button, the three options are gone, but the text
for the first option, "1st" still remains.
Whiteboard: MAKINGTEST mdubinko@yahoo.com → [TESTCASE]
Tested on M8, Win32 the testcase showed no sign of a bug.
QA Contact: gerardok → phillip
QA Contact: phillip → gerardok
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
I'm not seeing problem anymore in my build (9-7-99) on linux.

I've removed my work around from
mozilla/mailnews/compose/resources/content/MsgComposeCommands.js

<               /* bug in the DOM? when I remove the last element, the text
<                  remains.  so for now, when I remove the last element, I add
<                  back a blank element, then remove it, so that it looks
<                    correct.  bug logged #11010 */
<               if (i == 1) {
<                       var opt = new Option(" ", " ");
<                       selectNode.add(opt, null);
<                       selectNode.remove(0);
<               }

marking this as fixed.
Mass update of qa contact
QA Contact: gerardok → janc
Component: DOM Level 1 → DOM HTML
QA contact Update
QA Contact: janc → desale
Updating QA contact to Shivakiran Tummala.
QA Contact: desale → stummala
verified on build Linux2001-06-26-21-trunk marking as verified
Status: RESOLVED → VERIFIED
This bug needs to be reopened.

I am seeing this in 2002060808-trunk Win98 build.  I don't know how long it has
been around, since I just started tickling this bug with a new application.

The given test case fails.  Also, removing all nodes using DOM manipulation ala:

while (SelectNode.hasChildren())
    SelectNode.removeChild(SelectNode.lastChild);

fails the same way.
Component: DOM: HTML → DOM: Core & HTML
QA Contact: stummala → general
You need to log in before you can comment on or make changes to this bug.