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

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: Rename variable 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..5ff38b8f7299f9518efb9603387d6678a3ce66fe 100644
--- a/Source/devtools/front_end/elements/Spectrum.js
+++ b/Source/devtools/front_end/elements/Spectrum.js
@@ -313,8 +313,17 @@ WebInspector.Spectrum.prototype = {
return element.value;
}
- var element = /** @type {!Element} */(event.currentTarget);
- WebInspector.handleElementValueModifications(event, element);
+ var inputElement = /** @type {!Element} */(event.currentTarget);
+ var arrowKeyOrMouseWheelEvent = (event.keyIdentifier === "Up" || event.keyIdentifier === "Down" || event.type === "mousewheel");
+ var pageKeyPressed = (event.keyIdentifier === "PageUp" || event.keyIdentifier === "PageDown");
+ if (arrowKeyOrMouseWheelEvent || pageKeyPressed) {
+ var newValue = WebInspector.createReplacementString(inputElement.value, event);
+ if (newValue) {
+ inputElement.value = newValue;
+ inputElement.selectionStart = 0;
+ inputElement.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