Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: DebugConsole jumps to bottom on every componentDidUpdate #38587

Merged
merged 6 commits into from Jan 22, 2021

Conversation

maddiedierker
Copy link
Contributor

@maddiedierker maddiedierker commented Jan 15, 2021

Fixes a bug where clicking anywhere in the debug console output caused it to jump to the bottom of the output. Now, it will only jump to the bottom when something new is logged to the debug console.

Also some small clean-up because I couldn't resist. I'd recommend hiding whitespace changes when looking at the diff.

Links

Testing story

Reviewer Checklist:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

Comment on lines +217 to +229
componentDidUpdate(prevProps) {
const prevOutputSize = prevProps.logOutput.size;
if (
typeof prevOutputSize === 'number' &&
prevOutputSize !== this.props.logOutput.size
) {
this.jumpToBottom();
}
}

jumpToBottom = () => {
this._debugOutput.scrollTop = this._debugOutput.scrollHeight;
};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note to reviewers: this is the functional change -- the rest of the changes in this file are clean-up

@maddiedierker maddiedierker changed the title Debug console scroll Bugfix: DebugConsole jumps to bottom on every componentDidUpdate Jan 16, 2021
@maddiedierker maddiedierker requested a review from a team January 19, 2021 17:29
Copy link
Contributor

@ajpal ajpal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the cleanup also!

@maddiedierker maddiedierker merged commit 6e06d5a into staging Jan 22, 2021
@maddiedierker maddiedierker deleted the debug-console-scroll branch January 22, 2021 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants