Skip to content

Commit

Permalink
fix(ColorPicker): allow empty alpha field (#2162)
Browse files Browse the repository at this point in the history
  • Loading branch information
syeo66 authored Jan 15, 2025
1 parent 76b51be commit 010074e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/big-taxis-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@frontify/fondue-components": patch
---

fix(ColorPicker): allow empty alpha field
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ export const ColorValueInput = (
<TextInput.Root
data-test-id="color-picker-value-input-alpha"
className={styles.valueInput}
value={currentColor.alpha === undefined ? 100 : Math.trunc(currentColor.alpha * 100)}
/* .toString() is a workaround for https://github.com/facebook/react/issues/9402 */
value={currentColor.alpha === undefined ? 100 : Math.trunc(currentColor.alpha * 100).toString()}
type="number"
onChange={(event) => {
onColorChange({
Expand Down

0 comments on commit 010074e

Please sign in to comment.