From ff1efb5007e0d96f2e05591e3a5b0b76d185c818 Mon Sep 17 00:00:00 2001 From: "masayuki%d-toybox.com" Date: Mon, 19 Sep 2005 04:07:13 +0000 Subject: [PATCH] Bug 309030 Don't scroll to found link on findbar close r=mconnor --- toolkit/components/typeaheadfind/content/findBar.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/toolkit/components/typeaheadfind/content/findBar.js b/toolkit/components/typeaheadfind/content/findBar.js index c4f28b5aadb..ee1b7e26955 100755 --- a/toolkit/components/typeaheadfind/content/findBar.js +++ b/toolkit/components/typeaheadfind/content/findBar.js @@ -397,8 +397,14 @@ function delayedCloseFindBar() var focusedElement = document.commandDispatcher.focusedElement; if (focusedElement && (focusedElement.parentNode == findToolbar || focusedElement.parentNode.parentNode == findField)) { - if (gFoundLink) + if (gFoundLink) { + // block scrolling on focus since find already scrolls, further + // scrolling is due to user action, so don't override this + var suppressedScroll = document.commandDispatcher.suppressFocusScroll; + document.commandDispatcher.suppressFocusScroll = true; gFoundLink.focus(); + document.commandDispatcher.suppressFocusScroll = suppressedScroll; + } else window.content.focus(); }