We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
From this discord thread, the native HTML5 color picker won't open inside an array field.
The color picker didn't open
The color picker is shown
import { ComponentConfig, DropZone, FieldLabel } from "@measured/puck"; export type FlexBlockProps = { items: { minItemWidth?: number, itemColor: string }[]; minItemWidth: number; } export const FlexBlock: ComponentConfig<FlexBlockProps> = { fields: { items: { type: "array", label: "Items", arrayFields: { minItemWidth: { label: "Minimum Item Width", type: "number", min: 0, }, itemColor: { type: "custom", label: "Color", render: ({ name, onChange, value, field }) => ( <FieldLabel label={field.label!}> <input type="color" defaultValue={value} name={name} onChange={(e) => onChange(e.currentTarget.value)} /> </FieldLabel> ) } }, getItemSummary: (arrayFields, id = -1) => `Item ${id + 1}`, }, minItemWidth: { label: "Minimum Item Width", type: "number", min: 0, }, }, defaultProps: { items: [{ itemColor: '#ff0000' }, { itemColor: '#ff0000' }], minItemWidth: 356, }, render: ({ items, minItemWidth }) => { return ( <div className="flex-container"> {items.map((item, idx) => ( <div key={idx} className="flex-item" style={{ minWidth: item.minItemWidth || minItemWidth, color: item.itemColor }} > <DropZone zone={`item-${idx}`} /> </div> ))} </div> ); }, };
The text was updated successfully, but these errors were encountered:
No branches or pull requests
From this discord thread, the native HTML5 color picker won't open inside an array field.
Steps to reproduce
What happens
The color picker didn't open
What I expected to happen
The color picker is shown
Code example
The text was updated successfully, but these errors were encountered: