From 5bec360bee1b3c96e9f62524892fd82b92487a82 Mon Sep 17 00:00:00 2001 From: Mads Lie Jensen Date: Mon, 19 Oct 2020 21:10:45 +0200 Subject: [PATCH] Show color in ColorInputComponent, just like in ColorFieldComponent --- src/index.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index e0d7312..6034ec0 100644 --- a/src/index.js +++ b/src/index.js @@ -6,6 +6,7 @@ import TextField from '@material-ui/core/TextField'; import * as ReactColor from 'react-color'; import get from 'lodash.get'; import pure from 'recompose/pure'; +import InputAdornment from '@material-ui/core/InputAdornment'; require('./ColorInput.css'); @@ -88,6 +89,17 @@ class ColorInputComponent extends React.Component { error={!!(touched && error)} helperText={touched && error || helperText} className={className} + InputProps={{ + startAdornment: +
+ , + }} /> { this.state.show? @@ -133,4 +145,4 @@ ColorInputComponent.defaultProps = { }; export const ColorField = PureTextField; -export const ColorInput = addField(ColorInputComponent); \ No newline at end of file +export const ColorInput = addField(ColorInputComponent);