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

Add dnd.isDisabled option in the Puck component to disable drag and drop #555

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ProGM
Copy link

@ProGM ProGM commented Aug 12, 2024

Hi there!

Here I am again with a new PR.

This adds the option to disable the drag and drop feature of the editor.

Usage:

export function Editor() {
  return (
    <Puck
       dnd={{ isDisabled: true }}
       data={{ ... }}
        /*...*/
    />
  );
}

Copy link

vercel bot commented Aug 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
puck-docs ✅ Ready (Inspect) Visit Preview Aug 12, 2024 5:05pm

Copy link

vercel bot commented Aug 12, 2024

@ProGM is attempting to deploy a commit to the Measured Team on Vercel.

A member of the Team first needs to authorize it.

@ProGM
Copy link
Author

ProGM commented Aug 14, 2024

Auto-bug report:
when I disable drag and drop using the attribute I've added, the side outline section starts to break with this error:

Screenshot 2024-08-14 at 17 41 03

The problem is here:
https://github.com/measuredco/puck/blob/main/packages/plugin-heading-analyzer/src/HeadingAnalyzer.tsx#L167

When the drag and drop is disabled, the [${dataAttr}="${props.analyzeId}"] selector returns a broken item without the style set. Weird, it looks like the heading analyzer is strictly dependent to the drag and drop library.

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

Successfully merging this pull request may close these issues.

None yet

1 participant