Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
8a72d3a
export typeahead utils
Michele-Masciave Apr 11, 2025
f8dc2b0
integrate placeholder fix and changelog
Michele-Masciave Apr 16, 2025
a857384
adjust typescript
Michele-Masciave Apr 16, 2025
e1267ef
prepare-pr
Michele-Masciave Apr 28, 2025
12211f1
fixed
Michele-Masciave Apr 30, 2025
92e5c21
Merge branch 'main' of https://github.com/Michele-Masciave/react-hook…
Michele-Masciave Apr 30, 2025
a9347da
Merge branch 'neolution-ch:main' into main
Michele-Masciave May 7, 2025
2987413
Merge branch 'neolution-ch:main' into main
Michele-Masciave Jun 3, 2025
acad69e
Merge branch 'main' of https://github.com/Michele-Masciave/react-hook…
Michele-Masciave Jun 13, 2025
de96e5c
Merge branch 'neolution-ch:main' into main
Michele-Masciave Jun 18, 2025
fbfcc8e
Merge branch 'neolution-ch:main' into main
Michele-Masciave Jun 25, 2025
b5c2533
Merge branch 'main' of https://github.com/Michele-Masciave/react-hook…
Michele-Masciave Jul 7, 2025
7843d38
Merge branch 'neolution-ch:main' into main
Michele-Masciave Jul 16, 2025
6b81771
Merge branch 'neolution-ch:main' into main
Michele-Masciave Sep 26, 2025
743acf1
Merge branch 'neolution-ch:main' into main
Michele-Masciave Sep 29, 2025
022db3c
Merge branch 'neolution-ch:main' into main
Michele-Masciave Oct 1, 2025
bbd78a7
Merge branch 'neolution-ch:main' into main
Michele-Masciave Oct 21, 2025
5d28ea3
Merge branch 'neolution-ch:main' into main
Michele-Masciave Dec 3, 2025
3e9f9a7
Merge branch 'neolution-ch:main' into main
Michele-Masciave Dec 10, 2025
814c18e
Merge branch 'neolution-ch:main' into main
Michele-Masciave Dec 15, 2025
a2108d9
Merge branch 'neolution-ch:main' into main
Michele-Masciave Jan 8, 2026
349cd68
Merge branch 'neolution-ch:main' into main
Michele-Masciave Jan 13, 2026
b94770b
Merge branch 'neolution-ch:main' into main
Michele-Masciave Feb 6, 2026
22cb448
Merge branch 'neolution-ch:main' into main
Michele-Masciave Feb 17, 2026
4a8cfb6
Merge branch 'neolution-ch:main' into main
Michele-Masciave Mar 3, 2026
f244435
Merge branch 'neolution-ch:main' into main
Michele-Masciave Apr 15, 2026
9623ce9
x
Michele-Masciave Apr 15, 2026
57413ec
x
Michele-Masciave Apr 15, 2026
e318bbe
fix
Michele-Masciave Apr 15, 2026
e1d49ad
test
Michele-Masciave Apr 15, 2026
c586e21
test
Michele-Masciave Apr 15, 2026
37d3cdc
revert
Michele-Masciave Apr 15, 2026
fb77a23
x
Michele-Masciave Apr 15, 2026
a1d30ef
test
Michele-Masciave Apr 15, 2026
f495ce0
x
Michele-Masciave Apr 15, 2026
b956d51
revert
Michele-Masciave Apr 15, 2026
d60f2b9
test
Michele-Masciave Apr 15, 2026
bd0a43a
test
Michele-Masciave Apr 15, 2026
8579cc1
x
Michele-Masciave Apr 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- `ColorPicker` controlled/uncontrolled state warning by ensuring value prop is always defined.
- `ColorPicker` clear value when field value is already set.

## [4.1.0] - 2026-03-16

### Added
Expand Down
6 changes: 4 additions & 2 deletions src/lib/components/ColorPicker/ColorPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const ColorPicker = <T extends FieldValues>(props: ColorPickerInputProps<T>) =>
disabled: formDisabled,
getFieldState,
setValue,
watch,
requiredFields,
formState: { errors },
hideValidationMessages,
Expand All @@ -65,7 +66,8 @@ const ColorPicker = <T extends FieldValues>(props: ColorPickerInputProps<T>) =>
});

const isDisabled = formDisabled || disabled;
const color = useMemo(() => new TinyColor(field.value), [field.value]);
const fieldValue = watch(name) as string | undefined;
const color = useMemo(() => new TinyColor(fieldValue), [fieldValue]);
const fieldError = get(errors, name) as FieldError | undefined;
const hideErrorMessage = useMemo(() => hideValidationMessages || hideValidationMessage, [hideValidationMessages, hideValidationMessage]);
const hasError = useMemo(() => !!fieldError, [fieldError]);
Expand Down Expand Up @@ -107,7 +109,7 @@ const ColorPicker = <T extends FieldValues>(props: ColorPickerInputProps<T>) =>

field.onBlur();
}}
value={field.value}
value={fieldValue ?? ""}
slotProps={{
input: {
startAdornment: (
Expand Down
Loading