From 7a8c672255611b0587fc80aa2592bfdb0a11e0f5 Mon Sep 17 00:00:00 2001 From: "rods%netscape.com" Date: Thu, 4 Jan 2001 12:22:29 +0000 Subject: [PATCH] When focus is removed and the the CBX is dropped down it rolls it up r=kmcclusk, sr=buster Bug 64079 --- layout/forms/nsComboboxControlFrame.cpp | 11 +++++++++-- layout/html/forms/src/nsComboboxControlFrame.cpp | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp index 9030326ce319..90acd8de6ecd 100644 --- a/layout/forms/nsComboboxControlFrame.cpp +++ b/layout/forms/nsComboboxControlFrame.cpp @@ -496,8 +496,15 @@ nsComboboxControlFrame::GetHorizontalInsidePadding(nsIPresContext* aPresContext, void nsComboboxControlFrame::SetFocus(PRBool aOn, PRBool aRepaint) { - mFocused = aOn?this:nsnull; - // Thiis is needed on a temporary basis. It causes the focus + if (aOn) { + mFocused = this; + } else { + mFocused = nsnull; + if (mDroppedDown) { + ToggleList(mPresContext); + } + } + // This is needed on a temporary basis. It causes the focus // rect to be drawn. This is much faster than ReResolvingStyle // Bug 32920 Invalidate(mPresContext, nsRect(0,0,mRect.width,mRect.height), PR_TRUE); diff --git a/layout/html/forms/src/nsComboboxControlFrame.cpp b/layout/html/forms/src/nsComboboxControlFrame.cpp index 9030326ce319..90acd8de6ecd 100644 --- a/layout/html/forms/src/nsComboboxControlFrame.cpp +++ b/layout/html/forms/src/nsComboboxControlFrame.cpp @@ -496,8 +496,15 @@ nsComboboxControlFrame::GetHorizontalInsidePadding(nsIPresContext* aPresContext, void nsComboboxControlFrame::SetFocus(PRBool aOn, PRBool aRepaint) { - mFocused = aOn?this:nsnull; - // Thiis is needed on a temporary basis. It causes the focus + if (aOn) { + mFocused = this; + } else { + mFocused = nsnull; + if (mDroppedDown) { + ToggleList(mPresContext); + } + } + // This is needed on a temporary basis. It causes the focus // rect to be drawn. This is much faster than ReResolvingStyle // Bug 32920 Invalidate(mPresContext, nsRect(0,0,mRect.width,mRect.height), PR_TRUE);