Skip to content

Commit 0b445d1

Browse files
committed
BUGFIX: Prevent error when entering hex value
Color library was incorrectly resolved when minified. So now I import the necessary method to check the hex value. Resolves: #55
1 parent 38632ed commit 0b445d1

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

Resources/Private/Scripts/ColorPickerEditor/src/ColorPickerEditor.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ export default class ColorPickerEditor extends PureComponent {
6767
presetColors = options.presetColors;
6868
}
6969

70-
console.log(this.props, 'colorpicker props');
71-
7270
return (
7371
<div>
7472
<NeosColorPicker

Resources/Private/Scripts/ColorPickerEditor/src/NeosColorPicker/Fields.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import reactCSS from 'reactcss';
3-
import color from 'react-color/lib/helpers/color';
3+
import {isValidHex} from 'react-color/lib/helpers/color';
44
import {EditableInput} from 'react-color/lib/components/common';
55

66
export const Fields = ({onChange, rgb, hsl, hex, disableAlpha}) => {
@@ -51,7 +51,7 @@ export const Fields = ({onChange, rgb, hsl, hex, disableAlpha}) => {
5151

5252
const handleChange = (data, e) => {
5353
if (data.hex) {
54-
if (color.isValidHex(data.hex)) {
54+
if (isValidHex(data.hex)) {
5555
onChange({
5656
hex: data.hex,
5757
source: 'hex'

Resources/Public/ColorPickerEditor/Plugin.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Resources/Public/ColorPickerEditor/Plugin.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)