In an editable menulist, the currently selected item is whichever item's label matches the value of the menulist. And when you select an item in the menulist, the widget copies the label of the item to the value of the menulist element. But if the item's label contains a non-breaking space, the widget converts that to a space in the process of copying it over. And then, since the value and the label don't match, the menuitem doesn't get selected. Instead, it's as if you selected the menuitem and then edited it (causing the item to get unselected in favor of your custom value). The menuitem widget should either preserve non-breaking spaces or consider them equivalent to regular spaces for purposes of comparison between its value and the labels of its menuitems.
Created attachment 226483 [details] simple testcase Here's a simple testcase that demonstrates the problem. It contains an editable menulist with two items, the second of which contains a non-breaking space. When you select an item, an oncommand listener pops up an alert showing you the value of the menulist's selectedIndex property. If you select the first item, which doesn't contain a non-breaking space, then the alert displays 0, which is correct, since that item's index in the list is 0. But if you select the second item, which does contain a non-breaking space, then the alert displays -1, which is incorrect, since that item's index in the list is 1.
Myk, WFM on SM trunk.
Hmm, indeed this works now. I guess it got fixed on the trunk.
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → WORKSFORME
Component: XP Toolkit/Widgets: Menus → XUL
QA Contact: xptoolkit.menus → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.