Tabbing out of dropdown does not reset selected item (bug 100188), r=rods@netscape.com, sr=attinasi@netscape.com
This commit is contained in:
@@ -510,9 +510,8 @@ nsComboboxControlFrame::SetFocus(PRBool aOn, PRBool aRepaint)
|
||||
} else {
|
||||
mFocused = nsnull;
|
||||
if (mDroppedDown) {
|
||||
ToggleList(mPresContext);
|
||||
}
|
||||
|
||||
mListControlFrame->ComboboxFinish(mDisplayedIndex);
|
||||
} else {
|
||||
// Fire onChange if selected index has changed due to keyboard
|
||||
// (see nsListControlFrame::UpdateSelection)
|
||||
if (mNeedToFireOnChange) {
|
||||
@@ -527,6 +526,7 @@ nsComboboxControlFrame::SetFocus(PRBool aOn, PRBool aRepaint)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This is needed on a temporary basis. It causes the focus
|
||||
// rect to be drawn. This is much faster than ReResolvingStyle
|
||||
|
||||
@@ -125,6 +125,13 @@ public:
|
||||
NS_IMETHOD GetOptionsContainer(nsIPresContext* aPresContext,
|
||||
nsIFrame** aFrame) = 0;
|
||||
|
||||
/**
|
||||
* Tell the selected list to roll up and ensure that the proper index is
|
||||
* selected, possibly firing onChange if the index has changed
|
||||
*
|
||||
* @param aIndex the index to actually select
|
||||
*/
|
||||
NS_IMETHOD ComboboxFinish(PRInt32 aIndex) = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2110,7 +2110,7 @@ nsListControlFrame::UpdateSelection()
|
||||
return rv;
|
||||
}
|
||||
|
||||
void
|
||||
NS_IMETHODIMP
|
||||
nsListControlFrame::ComboboxFinish(PRInt32 aIndex)
|
||||
{
|
||||
if (mComboboxFrame) {
|
||||
@@ -2129,6 +2129,8 @@ nsListControlFrame::ComboboxFinish(PRInt32 aIndex)
|
||||
FireOnChange();
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
||||
@@ -277,7 +277,7 @@ public:
|
||||
NS_IMETHOD SetOverrideReflowOptimization(PRBool aValue) { mOverrideReflowOpt = aValue; return NS_OK; }
|
||||
NS_IMETHOD GetOptionsContainer(nsIPresContext* aPresContext, nsIFrame** aFrame);
|
||||
NS_IMETHOD FireOnChange();
|
||||
|
||||
NS_IMETHOD ComboboxFinish(PRInt32 aIndex);
|
||||
|
||||
// nsISelectControlFrame
|
||||
NS_IMETHOD AddOption(nsIPresContext* aPresContext, PRInt32 index);
|
||||
@@ -362,7 +362,6 @@ protected:
|
||||
|
||||
// Dropped down stuff
|
||||
void SetComboboxItem(PRInt32 aIndex);
|
||||
void ComboboxFinish(PRInt32 aIndex);
|
||||
PRBool IsInDropDownMode();
|
||||
|
||||
// Selection
|
||||
|
||||
@@ -125,6 +125,13 @@ public:
|
||||
NS_IMETHOD GetOptionsContainer(nsIPresContext* aPresContext,
|
||||
nsIFrame** aFrame) = 0;
|
||||
|
||||
/**
|
||||
* Tell the selected list to roll up and ensure that the proper index is
|
||||
* selected, possibly firing onChange if the index has changed
|
||||
*
|
||||
* @param aIndex the index to actually select
|
||||
*/
|
||||
NS_IMETHOD ComboboxFinish(PRInt32 aIndex) = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -510,9 +510,8 @@ nsComboboxControlFrame::SetFocus(PRBool aOn, PRBool aRepaint)
|
||||
} else {
|
||||
mFocused = nsnull;
|
||||
if (mDroppedDown) {
|
||||
ToggleList(mPresContext);
|
||||
}
|
||||
|
||||
mListControlFrame->ComboboxFinish(mDisplayedIndex);
|
||||
} else {
|
||||
// Fire onChange if selected index has changed due to keyboard
|
||||
// (see nsListControlFrame::UpdateSelection)
|
||||
if (mNeedToFireOnChange) {
|
||||
@@ -527,6 +526,7 @@ nsComboboxControlFrame::SetFocus(PRBool aOn, PRBool aRepaint)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This is needed on a temporary basis. It causes the focus
|
||||
// rect to be drawn. This is much faster than ReResolvingStyle
|
||||
|
||||
@@ -2110,7 +2110,7 @@ nsListControlFrame::UpdateSelection()
|
||||
return rv;
|
||||
}
|
||||
|
||||
void
|
||||
NS_IMETHODIMP
|
||||
nsListControlFrame::ComboboxFinish(PRInt32 aIndex)
|
||||
{
|
||||
if (mComboboxFrame) {
|
||||
@@ -2129,6 +2129,8 @@ nsListControlFrame::ComboboxFinish(PRInt32 aIndex)
|
||||
FireOnChange();
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
||||
@@ -277,7 +277,7 @@ public:
|
||||
NS_IMETHOD SetOverrideReflowOptimization(PRBool aValue) { mOverrideReflowOpt = aValue; return NS_OK; }
|
||||
NS_IMETHOD GetOptionsContainer(nsIPresContext* aPresContext, nsIFrame** aFrame);
|
||||
NS_IMETHOD FireOnChange();
|
||||
|
||||
NS_IMETHOD ComboboxFinish(PRInt32 aIndex);
|
||||
|
||||
// nsISelectControlFrame
|
||||
NS_IMETHOD AddOption(nsIPresContext* aPresContext, PRInt32 index);
|
||||
@@ -362,7 +362,6 @@ protected:
|
||||
|
||||
// Dropped down stuff
|
||||
void SetComboboxItem(PRInt32 aIndex);
|
||||
void ComboboxFinish(PRInt32 aIndex);
|
||||
PRBool IsInDropDownMode();
|
||||
|
||||
// Selection
|
||||
|
||||
Reference in New Issue
Block a user