Skip to content

Commit

Permalink
Merge pull request #86 from yamada-ui/fix/palette-color-form
Browse files Browse the repository at this point in the history
  • Loading branch information
hirotomoyamada authored Aug 17, 2024
2 parents bc539a3 + f5120f3 commit fe6d0fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions components/form/palette-color-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
forwardRef,
Input,
useEyeDropper,
useUpdateEffect,
VStack,
} from "@yamada-ui/react"
import type { InputProps, StackProps } from "@yamada-ui/react"
Expand Down Expand Up @@ -92,6 +93,10 @@ const EditColorPicker: FC<EditColorPickerProps> = memo(
} catch {}
}

useUpdateEffect(() => {
setInputValue(f(color, format))
}, [color, format])

return (
<>
<Box position="relative" w="full">
Expand Down
4 changes: 4 additions & 0 deletions pages/palettes/[uuid]/hex-control-buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ const EditButton: FC<EditButtonProps> = memo(
setName(name)
}, [name])

useUpdateEffect(() => {
setColor(resolvedHex)
}, [resolvedHex])

return (
<Popover
isOpen={isOpen}
Expand Down

0 comments on commit fe6d0fb

Please sign in to comment.