Created
December 2, 2020 22:08
-
-
Save jasonLaster/b87cce77c3e59335db9cb81ea4c7bc6c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/src/devtools/client/webconsole/components/Output/ConsoleOutput.js b/src/devtools/client/webconsole/components/Output/ConsoleOutput.js | |
| index bc687900..a0f36c17 100644 | |
| --- a/src/devtools/client/webconsole/components/Output/ConsoleOutput.js | |
| +++ b/src/devtools/client/webconsole/components/Output/ConsoleOutput.js | |
| @@ -89,17 +89,21 @@ class ConsoleOutput extends Component { | |
| //KY do i need this? | |
| UNSAFE_componentWillUpdate(nextProps, nextState) { | |
| - console.log("willupdate nextProps", nextProps) | |
| - console.log("willupdate nextState", nextState) | |
| + console.log("willupdate nextProps", nextProps); | |
| + console.log("willupdate nextState", nextState); | |
| } | |
| //KY could we not use gtoolbox? | |
| componentDidUpdate(prevProps) { | |
| - console.log("didupdate", prevProps) | |
| + console.log("didupdate", prevProps); | |
| //was willupdate | |
| const messagesDelta = this.props.messages.size - prevProps.messages.size; | |
| + if (this.shouldScrollMessageId) { | |
| + node = ReactDOM.getCurrentNode(); | |
| + const messageNode = node.querySelector(`[data-message-id=${this.shouldScrollMessageId}]`); | |
| + } | |
| // When evaluation results are added, scroll to them. | |
| this.shouldScrollMessageId = null; | |
| @@ -111,9 +115,6 @@ class ConsoleOutput extends Component { | |
| } | |
| } | |
| - | |
| - | |
| - | |
| //was didupdate | |
| // this.maybeScrollToBottom(); | |
| @@ -124,7 +125,6 @@ class ConsoleOutput extends Component { | |
| (previous || this.shouldScrollMessageNode).scrollIntoView(); | |
| this.shouldScrollMessageNode = null; | |
| } | |
| - | |
| } | |
| maybeScrollToBottom() { | |
| diff --git a/src/devtools/client/webconsole/components/Output/Message.js b/src/devtools/client/webconsole/components/Output/Message.js | |
| index c7c7467a..bebd1bfc 100644 | |
| --- a/src/devtools/client/webconsole/components/Output/Message.js | |
| +++ b/src/devtools/client/webconsole/components/Output/Message.js | |
| @@ -399,12 +399,12 @@ class Message extends Component { | |
| { | |
| className: topLevelClasses.join(" "), | |
| ...mouseEvents, | |
| - ref: node => { | |
| - this.messageNode = node; | |
| - if (messageId == gToolbox.consoleOutput.shouldScrollMessageId) { | |
| - gToolbox.consoleOutput.shouldScrollMessageNode = node; | |
| - } | |
| - }, | |
| + // ref: node => { | |
| + // this.messageNode = node; | |
| + // if (messageId == gToolbox.consoleOutput.shouldScrollMessageId) { | |
| + // gToolbox.consoleOutput.shouldScrollMessageNode = node; | |
| + // } | |
| + // }, | |
| "data-message-id": messageId, | |
| "aria-live": type === MESSAGE_TYPE.COMMAND ? "off" : "polite", | |
| }, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment