Fixed selection in lists

git-svn-id: svn://10.0.0.236/trunk@46384 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rods%netscape.com
1999-09-08 19:54:30 +00:00
parent 26570657ff
commit 3d4e0155f9
2 changed files with 14 additions and 6 deletions

View File

@@ -1887,8 +1887,8 @@ nsListControlFrame::MouseUp(nsIDOMEvent* aMouseEvent)
PRBool optionIsDisabled;
if (NS_OK == IsTargetOptionDisabled(optionIsDisabled)) {
if (optionIsDisabled) {
mSelectedIndex = mSelectedIndexWhenPoppedDown;
if (IsInDropDownMode() == PR_TRUE && mComboboxFrame) {
mSelectedIndex = mSelectedIndexWhenPoppedDown;
mComboboxFrame->ListWasSelected(mPresContext);
}
return NS_OK;
@@ -1969,8 +1969,12 @@ nsListControlFrame::MouseDown(nsIDOMEvent* aMouseEvent)
// NS_ERROR_FAILURE is returned is it isn't over an option
PRBool optionIsDisabled;
if (NS_OK == IsTargetOptionDisabled(optionIsDisabled)) {
mSelectedIndex = mSelectedIndexWhenPoppedDown;
return NS_OK;
if (optionIsDisabled) {
if (IsInDropDownMode() == PR_TRUE) {
mSelectedIndex = mSelectedIndexWhenPoppedDown;
}
return NS_OK;
}
}
PRInt32 oldIndex;

View File

@@ -1887,8 +1887,8 @@ nsListControlFrame::MouseUp(nsIDOMEvent* aMouseEvent)
PRBool optionIsDisabled;
if (NS_OK == IsTargetOptionDisabled(optionIsDisabled)) {
if (optionIsDisabled) {
mSelectedIndex = mSelectedIndexWhenPoppedDown;
if (IsInDropDownMode() == PR_TRUE && mComboboxFrame) {
mSelectedIndex = mSelectedIndexWhenPoppedDown;
mComboboxFrame->ListWasSelected(mPresContext);
}
return NS_OK;
@@ -1969,8 +1969,12 @@ nsListControlFrame::MouseDown(nsIDOMEvent* aMouseEvent)
// NS_ERROR_FAILURE is returned is it isn't over an option
PRBool optionIsDisabled;
if (NS_OK == IsTargetOptionDisabled(optionIsDisabled)) {
mSelectedIndex = mSelectedIndexWhenPoppedDown;
return NS_OK;
if (optionIsDisabled) {
if (IsInDropDownMode() == PR_TRUE) {
mSelectedIndex = mSelectedIndexWhenPoppedDown;
}
return NS_OK;
}
}
PRInt32 oldIndex;