Commit f4a1ce74 authored by Erik Luo's avatar Erik Luo Committed by Commit Bot

DevTools: only hide breakpoint editor on external blurs

When opening the breakpoint editor and clicking on already-selected
text, focus can move from CodeMirror's scroller to its textarea.
This internal blur should not trigger a commit.

Screenshot: https://imgur.com/a/kzyWLYj

Bug: none
Change-Id: I096692aaf5fe38104e80c8628dee28d9ba21d2c5
Reviewed-on: https://chromium-review.googlesource.com/1181651Reviewed-by: default avatarDmitry Gozman <dgozman@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584663}
parent b5e60ea4
......@@ -667,9 +667,6 @@ Sources.DebuggerPlugin = class extends Sources.UISourceCodeFrame.Plugin {
editor.widget().element.addEventListener('keydown', async event => {
if (isEnterKey(event) && !event.shiftKey) {
event.consume(true);
if (event.ctrlKey)
event.consume(true);
const expression = editor.text();
if (event.ctrlKey || await ObjectUI.JavaScriptAutocomplete.isExpressionComplete(expression))
finishEditing.call(this, true);
......@@ -682,7 +679,8 @@ Sources.DebuggerPlugin = class extends Sources.UISourceCodeFrame.Plugin {
editor.widget().focus();
editor.widget().element.id = 'source-frame-breakpoint-condition';
editor.widget().element.addEventListener('blur', event => {
finishEditing.call(this, true);
if (event.relatedTarget && !event.relatedTarget.isSelfOrDescendant(editor.widget().element))
finishEditing.call(this, true);
}, true);
let finished = false;
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment