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 11, 2023
1 parent f284985 commit e326fb2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ColorPicker/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ function ColorPicker({
className="pgn__color-modal rounded shadow"
style={{ textAlign: 'start' }}
>
<HexColorPicker color={color || ''} onChange={setColor} />
<HexColorPicker color={hexValid ? color : '#105B3A'} onChange={setColor} />
<Form.Group className="pgn__hex-form" size="sm">
<div>
<Form.Label className="pgn__hex-label">Hex</Form.Label>
<Form.Control
className="pgn__hex-field"
isInvalid={!hexValid}
value={color}
value={hexValid ? color : '#105B3A'}
onChange={(e) => validateHex(e.target.value)}
data-testid="hex-input"
/>
Expand Down

0 comments on commit e326fb2

Please sign in to comment.