Bug 1549987 - Improve scrolling feel for quick open r=jlast
☠☠ backed out by d82ae6b2d2d9 ☠ ☠
authorDavid Walsh <dwalsh@mozilla.com>
Thu, 09 May 2019 16:44:41 +0000
changeset 532096 6d527b0b37b4092eb41e3f632306c29c7e30d082
parent 532095 2ec342f2be7772af673b1758b58857c477182e29
child 532097 11d0a9d33945acdff8b128b23bda54e7c92a17f6
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlast
bugs1549987
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1549987 - Improve scrolling feel for quick open r=jlast Removes the smoothscrolling for QuickOpen Differential Revision: https://phabricator.services.mozilla.com/D30420
devtools/client/debugger/src/components/QuickOpenModal.js
devtools/client/debugger/src/utils/result-list.js
--- a/devtools/client/debugger/src/components/QuickOpenModal.js
+++ b/devtools/client/debugger/src/components/QuickOpenModal.js
@@ -112,18 +112,17 @@ export class QuickOpenModal extends Comp
 
   componentDidUpdate(prevProps: Props) {
     const nowEnabled = !prevProps.enabled && this.props.enabled;
     const queryChanged = prevProps.query !== this.props.query;
 
     if (this.refs.resultList && this.refs.resultList.refs) {
       scrollList(
         this.refs.resultList.refs,
-        this.state.selectedIndex,
-        nowEnabled || !queryChanged
+        this.state.selectedIndex
       );
     }
 
     if (nowEnabled || queryChanged) {
       this.updateResults(this.props.query);
     }
   }
 
--- a/devtools/client/debugger/src/utils/result-list.js
+++ b/devtools/client/debugger/src/utils/result-list.js
@@ -4,39 +4,32 @@
 
 // @flow
 
 import { isFirefox } from "devtools-environment";
 import { transitionTimeout } from "../components/shared/Modal";
 
 export function scrollList(
   resultList: Element[],
-  index: number,
-  delayed: boolean = false
+  index: number
 ): void {
   if (!resultList.hasOwnProperty(index)) {
     return;
   }
 
   const resultEl = resultList[index];
 
   const scroll = () => {
     if (isFirefox()) {
-      resultEl.scrollIntoView({ block: "center", behavior: "smooth" });
+      resultEl.scrollIntoView({ block: "nearest", behavior: "auto" });
     } else {
       chromeScrollList(resultEl, index);
     }
   };
 
-  if (delayed) {
-    // Wait for Modal Transition timeout before scrolling to resultEl.
-    setTimeout(scroll, transitionTimeout + 10);
-    return;
-  }
-
   scroll();
 }
 
 function chromeScrollList(elem: Element, index: number): void {
   const resultsEl: any = elem.parentNode;
 
   if (!resultsEl || resultsEl.children.length === 0) {
     return;