Skip to content

Commit

Permalink
fix: [colorpicker] 修复value受控模式,传值为空时,value会变为白色 #1047
Browse files Browse the repository at this point in the history
  • Loading branch information
hidden7123 authored and albyben committed Jan 13, 2025
1 parent 2ff343f commit b3cb5b5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions components/color-picker/color-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ const InternalColorPicker = (props: Partial<IColorPickerProps>, ref: RefObject<I
useEffect(() => {
if (validateColor(value ?? inputColorValue)) {
setInputCorrectColorValue(value ?? inputColorValue)
} else {
setInputCorrectColorValue('')
}
}, [inputColorValue, value])

Expand Down

0 comments on commit b3cb5b5

Please sign in to comment.