From 952aaf50632e22c8cdade40bbfba453b25ca6139 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Thu, 17 Feb 2005 04:29:37 +0000 Subject: [PATCH] Setting selectedIndex should clear all "previous value" state so that onchange won't fire unless the user actually changes the value from the one set by setting selectedIndex. r=mats, sr=roc, a=roc git-svn-id: svn://10.0.0.236/trunk@169304 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/forms/nsListControlFrame.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mozilla/layout/forms/nsListControlFrame.cpp b/mozilla/layout/forms/nsListControlFrame.cpp index 4f65c8834de..dff664a1231 100644 --- a/mozilla/layout/forms/nsListControlFrame.cpp +++ b/mozilla/layout/forms/nsListControlFrame.cpp @@ -2205,7 +2205,9 @@ NS_IMETHODIMP nsListControlFrame::OnSetSelectedIndex(PRInt32 aOldIndex, PRInt32 aNewIndex) { if (mComboboxFrame) { - mComboboxFrame->UpdateRecentIndex(aOldIndex); + // UpdateRecentIndex with -1, so that we won't fire an onchange + // event for this setting of selectedIndex. + mComboboxFrame->UpdateRecentIndex(-1); } ScrollToIndex(aNewIndex);