Title: [221990] trunk/Source/WebInspectorUI
Revision
221990
Author
[email protected]
Date
2017-09-13 13:24:55 -0700 (Wed, 13 Sep 2017)

Log Message

Web Inspector: Escape in global search field should clear it
https://bugs.webkit.org/show_bug.cgi?id=176764

Patch by Joseph Pecoraro <[email protected]> on 2017-09-13
Reviewed by Timothy Hatcher.

* UserInterface/Views/QuickConsole.js:
(WI.QuickConsole.prototype._toggleOrFocus):
Don't implicitly prevent default. So if we didn't cause an action we
can let the default system action happen.

* UserInterface/Views/SearchBar.js:
(WI.SearchBar):
Remove unused keyboard shortcuts.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (221989 => 221990)


--- trunk/Source/WebInspectorUI/ChangeLog	2017-09-13 20:17:35 UTC (rev 221989)
+++ trunk/Source/WebInspectorUI/ChangeLog	2017-09-13 20:24:55 UTC (rev 221990)
@@ -1,3 +1,19 @@
+2017-09-13  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: Escape in global search field should clear it
+        https://bugs.webkit.org/show_bug.cgi?id=176764
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/QuickConsole.js:
+        (WI.QuickConsole.prototype._toggleOrFocus):
+        Don't implicitly prevent default. So if we didn't cause an action we
+        can let the default system action happen.
+
+        * UserInterface/Views/SearchBar.js:
+        (WI.SearchBar):
+        Remove unused keyboard shortcuts.
+
 2017-09-12  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: Add Experimental setting for new Network tab

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js (221989 => 221990)


--- trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js	2017-09-13 20:17:35 UTC (rev 221989)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js	2017-09-13 20:24:55 UTC (rev 221990)
@@ -30,6 +30,7 @@
         super(element);
 
         this._toggleOrFocusKeyboardShortcut = new WI.KeyboardShortcut(null, WI.KeyboardShortcut.Key.Escape, this._toggleOrFocus.bind(this));
+        this._toggleOrFocusKeyboardShortcut.implicitlyPreventsDefault = false;
 
         this._mainExecutionContextPathComponent = this._createExecutionContextPathComponent(WI.mainTarget.executionContext);
 
@@ -330,10 +331,13 @@
 
     _toggleOrFocus(event)
     {
-        if (this.prompt.focused)
+        if (this.prompt.focused) {
             WI.toggleSplitConsole();
-        else if (!WI.isEditingAnyField() && !WI.isEventTargetAnEditableField(event))
+            event.preventDefault();
+        } else if (!WI.isEditingAnyField() && !WI.isEventTargetAnEditableField(event)) {
             this.prompt.focus();
+            event.preventDefault();
+        }
     }
 
     _updateStyles()

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SearchBar.js (221989 => 221990)


--- trunk/Source/WebInspectorUI/UserInterface/Views/SearchBar.js	2017-09-13 20:17:35 UTC (rev 221989)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SearchBar.js	2017-09-13 20:24:55 UTC (rev 221990)
@@ -31,9 +31,6 @@
 
         this._element.classList.add("search-bar");
 
-        this._keyboardShortcutEsc = new WI.KeyboardShortcut(null, WI.KeyboardShortcut.Key.Escape);
-        this._keyboardShortcutEnter = new WI.KeyboardShortcut(null, WI.KeyboardShortcut.Key.Enter);
-
         this._searchInput = this._element.appendChild(document.createElement("input"));
         this._searchInput.type = "search";
         this._searchInput.spellcheck = false;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to