Backed out changeset 6d527b0b37b4 (bug 1549987) for debugger failure CLOSED TREE
authorshindli <shindli@mozilla.com>
Thu, 09 May 2019 21:55:04 +0300
changeset 532099 d82ae6b2d2d9dcd65b14721cac86494e955a1974
parent 532098 f74d8cca5c2d43a37226f80781e2ea0c0a3f7a58
child 532100 455d6f8a9d95bb4cd471e52c63fe03f64fa29d4e
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)
bugs1549987
milestone68.0a1
backs out6d527b0b37b4092eb41e3f632306c29c7e30d082
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
Backed out changeset 6d527b0b37b4 (bug 1549987) for debugger failure CLOSED TREE
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,17 +112,18 @@ 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
+        this.state.selectedIndex,
+        nowEnabled || !queryChanged
       );
     }
 
     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,32 +4,39 @@
 
 // @flow
 
 import { isFirefox } from "devtools-environment";
 import { transitionTimeout } from "../components/shared/Modal";
 
 export function scrollList(
   resultList: Element[],
-  index: number
+  index: number,
+  delayed: boolean = false
 ): void {
   if (!resultList.hasOwnProperty(index)) {
     return;
   }
 
   const resultEl = resultList[index];
 
   const scroll = () => {
     if (isFirefox()) {
-      resultEl.scrollIntoView({ block: "nearest", behavior: "auto" });
+      resultEl.scrollIntoView({ block: "center", behavior: "smooth" });
     } 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;