Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(819)

Unified Diff: third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js

Issue 2840663002: DevTools: clicking in console messages should not jump to bottom (Closed)
Patch Set: restore scroll pos, add test for old regression Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
index be61b1a8bbe8206cb165e078dad479ca8235a504..96a356344749ad9b7e69f945f6f3641afc4f7c49 100644
--- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
+++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
@@ -309,10 +309,11 @@ Console.ConsoleView = class extends UI.VBox {
focus() {
if (this._prompt.hasFocus())
return;
- // Set caret position before setting focus in order to avoid scrolling
- // by focus().
+ // Restore scroll position after focus.
+ var top = this._messagesElement.scrollTop;
this._prompt.moveCaretToEndOfPrompt();
pfeldman 2017/04/25 18:26:08 below the prompt. Could you elaborate on this? Is
luoe 2017/04/25 23:00:34 No, I really want the caret to move on messagesCli
this._prompt.focus();
+ this._messagesElement.scrollTop = top;
}
/**

Powered by Google App Engine
This is Rietveld 408576698