Skip to content
New issue

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

Problem overriding custom fields #569

Open
BR1G00 opened this issue Aug 19, 2024 · 0 comments
Open

Problem overriding custom fields #569

BR1G00 opened this issue Aug 19, 2024 · 0 comments

Comments

@BR1G00
Copy link

BR1G00 commented Aug 19, 2024

If you try to override the inputs using the functions, "fieldLabel" or "fieldTypes", they ignore the custom fields.

Here's a little example

<Puck<Config>
   ....
    overrides={{
      fieldLabel: ({ children, label, icon, el }) => {
         return <FieldLabel label={label} icon={icon} el={el}>
             <div>SOME TEXT</div>
            {children}
        </FieldLabel>
      }
    }}
/>

export const Heading: ComponentConfig<HeadingProps> = {
  label: 'Heading',
  fields: {
    backgroundColor: {
      type: 'custom',
      label: 'Background color',
      render: ({ field, onChange, value }) => {
        return (
            <GradientColorPicker
              colors={vbLightColors}
              value={value}
              isText={false}
              onChange={(color) => {
                onChange(color as string);
              }}
            />
        );
      },
    },
...``` the field overrides ignore my backgroundColor custom component.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant