Skip to content

Commit

Permalink
Merge the StyleWrapper styles with the draggable props from b-D&D. Th…
Browse files Browse the repository at this point in the history
…is fixes the D&D bug introduced in #5581
  • Loading branch information
sneridagh committed Jan 17, 2024
1 parent 669824b commit 8ec94e0
Showing 1 changed file with 7 additions and 2 deletions.
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

0 comments on commit 8ec94e0

Please sign in to comment.