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

Merge the StyleWrapper styles with the draggable props from b-D&D #5652

Merged
merged 2 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/volto/news/5652.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Merge the StyleWrapper styles with the draggable props from b-D&D. @sneridagh
This fixes the D&D bug introduced in https://github.com/plone/volto/pull/5581
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,22 @@ const EditBlockWrapper = (props) => {
const classNames = buildStyleClassNamesFromData(data.styles);
const style = buildStyleObjectFromData(data.styles);

// We need to merge the StyleWrapper styles with the draggable props from b-D&D
const styleMergedWithDragProps = {
...draginfo.draggableProps,
style: { ...style, ...draginfo.draggableProps.style },
};

return (
<div
ref={draginfo.innerRef}
{...draginfo.draggableProps}
{...styleMergedWithDragProps}
// Right now, we can have the alignment information in the styles property or in the
// block data root, we inject the classname here for having control over the whole
// Block Edit wrapper
className={cx(`block-editor-${data['@type']}`, classNames, {
[data.align]: data.align,
})}
style={style}
>
<div style={{ position: 'relative' }}>
<div
Expand Down