Bug 1287508 - Part 2: Update scroll pinning. r=bgrins
authorLin Clark <lclark@mozilla.com>
Mon, 18 Jul 2016 15:24:41 -0400
changeset 395260 26c34b9a3fd3746e455efa51075b85120525ba31
parent 395259 45170a42e54cddbd9b72d98953ff2d8225782bf7
child 395261 9968225662d37ba93260d4f429b08506b4012f52
push id24732
push userbmo:gps@mozilla.com
push dateMon, 01 Aug 2016 21:50:09 +0000
reviewersbgrins
bugs1287508
milestone50.0a1
Bug 1287508 - Part 2: Update scroll pinning. r=bgrins MozReview-Commit-ID: 8KGmtcwEsdv
devtools/client/webconsole/new-console-output/components/console-output.js
--- a/devtools/client/webconsole/new-console-output/components/console-output.js
+++ b/devtools/client/webconsole/new-console-output/components/console-output.js
@@ -22,26 +22,25 @@ const ConsoleOutput = createClass({
     // This function is created in mergeProps
     openVariablesView: PropTypes.func.isRequired,
     messages: PropTypes.array.isRequired
   },
 
   displayName: "ConsoleOutput",
 
   componentWillUpdate() {
-    // @TODO Move this to a parent component.
-    let node = ReactDOM.findDOMNode(this).parentNode.parentNode.parentNode;
+    let node = ReactDOM.findDOMNode(this);
     if (node.lastChild) {
       this.shouldScrollBottom = isScrolledToBottom(node.lastChild, node);
     }
   },
 
   componentDidUpdate() {
     if (this.shouldScrollBottom) {
-      let node = ReactDOM.findDOMNode(this).parentNode.parentNode.parentNode;
+      let node = ReactDOM.findDOMNode(this);
       node.scrollTop = node.scrollHeight;
     }
   },
 
   render() {
     let messageNodes = this.props.messages.map(function (message) {
       return (
         MessageContainer({ message })