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

Unified Diff: Source/devtools/front_end/elements/Spectrum.js

Issue 1175113007: Devtools: Fix "unable to change the value of R/G/B/A" in color picker (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | Source/devtools/front_end/ui/UIUtils.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/elements/Spectrum.js
diff --git a/Source/devtools/front_end/elements/Spectrum.js b/Source/devtools/front_end/elements/Spectrum.js
index f9cc1b59e09bb23a550e75016ba6af7bf83e9c11..6abd9087b48acb12720ef7ad7ba0e981489e526e 100644
--- a/Source/devtools/front_end/elements/Spectrum.js
+++ b/Source/devtools/front_end/elements/Spectrum.js
@@ -314,7 +314,16 @@ WebInspector.Spectrum.prototype = {
}
var element = /** @type {!Element} */(event.currentTarget);
- WebInspector.handleElementValueModifications(event, element);
+ var arrowKeyOrMouseWheelEvent = (event.keyIdentifier === "Up" || event.keyIdentifier === "Down" || event.type === "mousewheel");
+ var pageKeyPressed = (event.keyIdentifier === "PageUp" || event.keyIdentifier === "PageDown");
lushnikov 2015/06/18 15:36:06 why not a single "var whitelistedEvent = ..." ?
sergeyv 2015/06/18 16:55:36 Acknowledged.
+ if (arrowKeyOrMouseWheelEvent || pageKeyPressed) {
+ var newValue = WebInspector.createReplacementString(element.value, event);
+ if (newValue) {
+ element.value = newValue;
+ element.selectionStart = 0;
lushnikov 2015/06/18 15:36:06 are these defined on HTMLInputElement only? Can we
sergeyv 2015/06/18 16:55:36 renamed inputElement
+ element.selectionEnd = newValue.length;
+ }
+ }
const cf = WebInspector.Color.Format;
var colorString;
« no previous file with comments | « no previous file | Source/devtools/front_end/ui/UIUtils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698