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

This commit is contained in:
mats.palmgren%bredband.net 2005-10-22 03:47:00 +00:00
Родитель e7e62f956e
Коммит bb5f71a7f4
1 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -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;
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);
}