| 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 62a38991859bb73292acb4902c962082e42fb498..c68adc33dbd82634600172147a30149a35c31263 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
|
| @@ -310,12 +310,8 @@ Console.ConsoleView = class extends UI.VBox {
|
| * @override
|
| */
|
| focus() {
|
| - if (this._prompt.hasFocus())
|
| - return;
|
| - // Set caret position before setting focus in order to avoid scrolling
|
| - // by focus().
|
| - this._prompt.moveCaretToEndOfPrompt();
|
| - this._prompt.focus();
|
| + if (!this._prompt.hasFocus())
|
| + this._prompt.focus();
|
| }
|
|
|
| /**
|
| @@ -679,8 +675,14 @@ Console.ConsoleView = class extends UI.VBox {
|
| */
|
| _messagesClicked(event) {
|
| var targetElement = event.deepElementFromPoint();
|
| - if (!targetElement || targetElement.isComponentSelectionCollapsed())
|
| +
|
| + // Do not focus prompt if messages have selection.
|
| + if (!targetElement || targetElement.isComponentSelectionCollapsed()) {
|
| + var clickedOutsideMessageList = event.target === this._messagesElement;
|
| + if (clickedOutsideMessageList)
|
| + this._prompt.moveCaretToEndOfPrompt();
|
| this.focus();
|
| + }
|
| var groupMessage = event.target.enclosingNodeOrSelfWithClass('console-group-title');
|
| if (!groupMessage)
|
| return;
|
|
|