added "asChild" for trigger and type="button", not submit

prevents dialogs being closed by accident
This commit is contained in:
Oliver Bryan
2026-01-12 00:55:47 +00:00
parent 3b00ad65ee
commit e53bba06d0

View File

@@ -12,8 +12,8 @@ export default function ColourPicker({
}) {
return (
<Popover>
<PopoverTrigger>
<Button className="w-8 h-8" style={{ backgroundColor: colour }}></Button>
<PopoverTrigger asChild>
<Button type="button" className="w-8 h-8" style={{ backgroundColor: colour }} />
</PopoverTrigger>
<PopoverContent className="w-fit grid gap-2 p-2" align="start" side={"top"}>
<HexColorPicker color={colour} onChange={onChange} className="p-0 m-0" />