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

Drag and Drop posts within editor #203

Closed
mogmarsh opened this issue Jul 17, 2024 · 0 comments · Fixed by #206
Closed

Drag and Drop posts within editor #203

mogmarsh opened this issue Jul 17, 2024 · 0 comments · Fixed by #206
Assignees
Labels
enhancement New feature or request gutenberg Requires understanding Gutenberg typescript Requires understanding TypeScript

Comments

@mogmarsh
Copy link
Collaborator

mogmarsh commented Jul 17, 2024

Description

Either using the existing Gutenberg drag and drop controls, or by adding a new drag handle to the Post block, we should add functionality to move a post to a new spot in the editor.

Each Post block should have a drag handle or use the Gutenberg one if possible.
Each Post block should be a drop zone.
The drag action should include a payload with the Post ID, any Post customizations, and the block ID of the Post being dragged.

If a drop action is received, the Post info in the payload should be set on the receiving block, and the pinned post should be removed from the originating block via the block ID.

Drag and drop should not affect the layout of the block or any block attributes such as class names, etc. The post should be moved to the new location, and that is all.

If a post was previously pinned in the receiving block, it should just be wiped out (or maybe swapped). We don't want to shift posts.

For first implementation, let's just worry about dragging and dropping within the same Query block, but if it happens to work across Query blocks, that's great.

Use Case

Moving a pinned post from one slot to another should be easier.

@mogmarsh mogmarsh added enhancement New feature or request typescript Requires understanding TypeScript gutenberg Requires understanding Gutenberg labels Jul 17, 2024
@mogmarsh mogmarsh self-assigned this Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request gutenberg Requires understanding Gutenberg typescript Requires understanding TypeScript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant