Don't compare the displayed value against the "selected index" in dropped down mode since that is actually the "hovered index". b=313260 r+sr=bzbarsky

git-svn-id: svn://10.0.0.236/trunk@182769 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mats.palmgren%bredband.net
2005-10-22 03:47:00 +00:00
parent 1cd340798f
commit 57d905a9da

View File

@@ -1214,7 +1214,14 @@ nsComboboxControlFrame::Reflow(nsPresContext* aPresContext,
// Make sure the displayed text is the same as the selected option, bug 297389.
PRInt32 selectedIndex;
nsAutoString selectedOptionText;
mListControlFrame->GetSelectedIndex(&selectedIndex);
if (!mDroppedDown) {
mListControlFrame->GetSelectedIndex(&selectedIndex);
}
else {
// In dropped down mode the "selected index" is the hovered menu item,
// we want the last selected item which is |mDisplayedIndex| in this case.
selectedIndex = mDisplayedIndex;
}
if (selectedIndex != -1) {
mListControlFrame->GetOptionText(selectedIndex, selectedOptionText);
}