Make sure we fire onchange also after selectedIndex was set to -1 through DOM. Thanks to Pablo Greco for helping fix this. b=317078 r+sr=roc
git-svn-id: svn://10.0.0.236/trunk@212915 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1977,8 +1977,8 @@ nsListControlFrame::FireOnChange()
|
||||
{
|
||||
if (mComboboxFrame) {
|
||||
// Return hit without changing anything
|
||||
PRInt32 index = mComboboxFrame->UpdateRecentIndex(-1);
|
||||
if (index == -1)
|
||||
PRInt32 index = mComboboxFrame->UpdateRecentIndex(NS_SKIP_NOTIFY_INDEX);
|
||||
if (index == NS_SKIP_NOTIFY_INDEX)
|
||||
return;
|
||||
|
||||
// See if the selection actually changed
|
||||
@@ -2009,9 +2009,9 @@ NS_IMETHODIMP
|
||||
nsListControlFrame::OnSetSelectedIndex(PRInt32 aOldIndex, PRInt32 aNewIndex)
|
||||
{
|
||||
if (mComboboxFrame) {
|
||||
// UpdateRecentIndex with -1, so that we won't fire an onchange
|
||||
// UpdateRecentIndex with NS_SKIP_NOTIFY_INDEX, so that we won't fire an onchange
|
||||
// event for this setting of selectedIndex.
|
||||
mComboboxFrame->UpdateRecentIndex(-1);
|
||||
mComboboxFrame->UpdateRecentIndex(NS_SKIP_NOTIFY_INDEX);
|
||||
}
|
||||
|
||||
ScrollToIndex(aNewIndex);
|
||||
|
||||
Reference in New Issue
Block a user