Open
Bug 275737
Opened 20 years ago
Updated 2 years ago
removing menulist children causes errors
Categories
(Core :: XUL, defect)
Tracking
()
UNCONFIRMED
People
(Reporter: sean, Unassigned)
Details
menulist.removechild(menulist.selectedItem) does not reset the value of menulist. It retains its label, and errors the next time you click the dropdown. Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIMenuBoxObject.activeChild]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://global/content/bindings/menulist.xml :: onxblpopupshowing :: line 35" data: no
Reporter | ||
Updated•20 years ago
|
Component: General → XP Apps: GUI Features
Assignee: general → nobody
Component: XP Apps: GUI Features → XP Toolkit/Widgets: Menus
Product: Mozilla Application Suite → Core
QA Contact: general
Comment 1•20 years ago
|
||
Removing the selected item is not nice in any widget... So, any suggestions as to the "correct" fix? 1. Just bulletproof the activeChild logic 2. Write an XBL destructor for menuitems to deselect them 3. Write a C++ destructor for menuitems to deselect them
Comment 2•20 years ago
|
||
I don't really know enough about how menulists are set up to tell which of those is best....
Reporter | ||
Comment 3•20 years ago
|
||
Would it be as simple as placing a destructor in toolkit/content/widgets/menu.xml#menuitem-base ? <destructor> if this.isSameNode(parentNode.selectedItem) parentNode.selectedIndex=-1; </destructor>
Comment 4•20 years ago
|
||
That is a (failed) attempt at case 2, yes...
Comment 5•20 years ago
|
||
In an email bz seems to prefer option 3. This would involve adding a check to the selectedItem getter to check that the item's parent is still the menulist.
Component: XP Toolkit/Widgets: Menus → XUL
QA Contact: xptoolkit.widgets
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•