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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js

Issue 2545983002: DevTools: Use TextPrompt for FilterBar instead of input element (Closed)
Patch Set: Use textWithCurrentSuggestion Created 4 years 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/ui/TextPrompt.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js b/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js
index a661c55b58ac966ff1cf71918602b4e3a2820148..8113627b4912b4cd035a5989f2c3b949b54080c4 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js
@@ -196,6 +196,13 @@ UI.TextPrompt = class extends Common.Object {
this._proxyElement.title = title;
}
+ /**
+ * @param {string} placeholder
+ */
+ setPlaceholder(placeholder) {
+ this._element.setAttribute('data-placeholder', placeholder);
+ }
+
_removeFromElement() {
this.clearAutocomplete();
this._element.removeEventListener('keydown', this._boundOnKeyDown, false);
@@ -317,11 +324,16 @@ UI.TextPrompt = class extends Common.Object {
}
clearAutocomplete() {
+ var beforeText = this.textWithCurrentSuggestion();
+
if (this._isSuggestBoxVisible())
this._suggestBox.hide();
this._clearAutocompleteTimeout();
this._queryRange = null;
this._refreshGhostText();
+
+ if (beforeText !== this.textWithCurrentSuggestion())
+ this.dispatchEventToListeners(UI.TextPrompt.Events.ItemApplied);
}
_refreshGhostText() {

Powered by Google App Engine
This is Rietveld 408576698