react-best-gradient-color-picker
Advanced tools
Comparing version 1.0.8 to 1.0.9
@@ -24,4 +24,4 @@ import React, { createContext, useContext, useState, useEffect } from 'react'; | ||
const [selectedColor, setSelectedColor] = useState(0); | ||
const initials = getInitialValues(colors, selectedColor); | ||
const [color, setColor] = useState(initials?.c); | ||
const initials = getInitialValues(colors, selectedColor); // const [color, setColor] = useState(initials?.c) | ||
const [hue, setHue] = useState(initials?.h); | ||
@@ -52,7 +52,5 @@ const [hueX, setHueX] = useState(initials?.hx); | ||
if (newGrad?.includes('gradient')) { | ||
setColor(newGrad); | ||
onChange(newGrad); | ||
} | ||
} else { | ||
setColor(newColor); | ||
onChange(newColor); | ||
@@ -104,3 +102,3 @@ } | ||
colors.push({ | ||
value: color, | ||
value: '', | ||
left: left / 2.8, | ||
@@ -107,0 +105,0 @@ opacity: 100, |
{ | ||
"name": "react-best-gradient-color-picker", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "An easy to use color/gradient picker for React.js", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -18,3 +18,3 @@ import React, { createContext, useContext, useState, useEffect } from 'react'; | ||
const initials = getInitialValues(colors, selectedColor) | ||
const [color, setColor] = useState(initials?.c) | ||
// const [color, setColor] = useState(initials?.c) | ||
const [hue, setHue] = useState(initials?.h) | ||
@@ -40,7 +40,5 @@ const [hueX, setHueX] = useState(initials?.hx) | ||
if (newGrad?.includes('gradient')) { | ||
setColor(newGrad) | ||
onChange(newGrad) | ||
} | ||
} else { | ||
setColor(newColor) | ||
onChange(newColor) | ||
@@ -91,3 +89,3 @@ } | ||
let left = computeBarPosition(e, offsetLeft) | ||
colors.push({value: color, left: left / 2.8, opacity: 100, hsl: hsl }) | ||
colors.push({value: '', left: left / 2.8, opacity: 100, hsl: hsl }) | ||
handleSelectedColor(e, newIndex) | ||
@@ -94,0 +92,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41874
1230