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

Dropzone not working #878

Closed
Rkaede opened this issue Feb 5, 2025 · 2 comments
Closed

Dropzone not working #878

Rkaede opened this issue Feb 5, 2025 · 2 comments

Comments

@Rkaede
Copy link

Rkaede commented Feb 5, 2025

Hi there,

First off, Puck is an incredible library. It's really well thought out and has a beautiful API. Thank you so much for putting this out into the world. 🙏

I'm having issues using the DropZone component with our in-house component library. Here's an example codesandbox of the setup:

https://codesandbox.io/p/sandbox/4fpn9f?file=%2Fsrc%2FEditor.tsx

We're trying to nest a two levels deep using the DropZone component: ComponentA > ComponentB > ComponentC.

This works great in the sandbox above. However, when we use our in-house "ComponentB" component, we can no longer drop a "ComponentC" onto it.

import { ComponentB } from '@internal/components';

const config = {
  components: {
    ComponentB: {
      fields: {},
      defaultProps: {},
      render: () => {
        return (
          <ComponentB> // if we change this to a div it works fine.
            <DropZone zone="component-b" />
          </ComponentB>
        );
      },
    },
    //... other components
  },
};

Are there any common pitfalls that we need to check for in our ComponentB?

@FedericoBonel
Copy link
Collaborator

Hello @Rkaede,

I tried replicating your issue in a local setup, but it worked as expected, just like in the sandbox you provided.

Could you provide more details about the problem? Specifically:

  1. After dragging and dropping a ComponentB, are you unable to add a ComponentC inside it?
  2. Can you add other components inside ComponentB?
  3. Could you share an example of how your in-house ComponentB is implemented?

This will help me better understand and troubleshoot the issue.

@FedericoBonel
Copy link
Collaborator

Since there haven’t been any updates, I’ll be closing this issue. Let me know if you’d like it reopened!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants