Skip to content

Commit

Permalink
Prevent invalid initial color to be accepted as preset
Browse files Browse the repository at this point in the history
  • Loading branch information
ghengeveld committed Mar 30, 2021
1 parent 2c6b796 commit b1ee5e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/components/src/controls/Color.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ const usePresets = (
currentColor: ParsedColor,
colorSpace: ColorSpace
) => {
const [selectedColors, setSelectedColors] = useState(currentColor ? [currentColor] : []);
const [selectedColors, setSelectedColors] = useState(currentColor?.valid ? [currentColor] : []);

const presets = useMemo(() => {
const initialPresets = (presetColors || []).map((preset) => {
Expand Down

0 comments on commit b1ee5e9

Please sign in to comment.