Skip to content

Commit

Permalink
fix: [colorPicker] 修复visible受控模式下,onVisibleChange始终返回false #1045
Browse files Browse the repository at this point in the history
  • Loading branch information
hidden7123 authored and albyben committed Jan 13, 2025
1 parent 734efe7 commit 139217c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions components/color-picker/color-picker-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,12 @@ const ColorPickerPanel: FC<IColorPickerPanelProps> = (props) => {
if (typeof visible === 'undefined') {
setShowPanel(false)
}
showPanel && onVisibleChange && onVisibleChange(false)
})

useEffect(() => {
if (onVisibleChange) {
onVisibleChange(visible)
}
}, [visible])
useEffect(() => {
if (showPanel) {
const scrollAlign = debounce((e: Event) => {
Expand Down

0 comments on commit 139217c

Please sign in to comment.