Skip to content

Commit

Permalink
fix: add default color for not valid value
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyrylo Hudym-Levkovych authored and Kyrylo Hudym-Levkovych committed Oct 13, 2023
1 parent f284985 commit 4622b17
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ColorPicker/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { OverlayTrigger } from '../Overlay';
import Tooltip from '../Tooltip';
import useToggle from '../hooks/useToggle';

const DEFAULT_COLOR = '#fefefe';

function ColorPicker({
color, setColor, className, size,
}) {
Expand Down Expand Up @@ -65,7 +67,7 @@ function ColorPicker({
className="pgn__color-modal rounded shadow"
style={{ textAlign: 'start' }}
>
<HexColorPicker color={color || ''} onChange={setColor} />
<HexColorPicker color={hexValid ? color : DEFAULT_COLOR} onChange={setColor} />
<Form.Group className="pgn__hex-form" size="sm">
<div>
<Form.Label className="pgn__hex-label">Hex</Form.Label>
Expand Down

0 comments on commit 4622b17

Please sign in to comment.