Fixes an issue in the addExtraDropzonePadding method that causes structure components with non-pixel padding values to be overwritten with 4px padding (via DRAG_PADDING const) when dragging components.
For example, this section has 5% left/right padding, and when starting to drag the padding is changed to 4px (to show the bug that was happening before the change)
The purpose of this addExtraDropzonePadding method is to add a little padding when dragging, so that dropzones will activate in structure components that have children elements taking up the full size of the component.
Purpose
Fixes an issue in the
addExtraDropzonePadding
method that causes structure components with non-pixel padding values to be overwritten with4px
padding (viaDRAG_PADDING
const) when dragging components.For example, this section has
5%
left/right padding, and when starting to drag the padding is changed to4px
(to show the bug that was happening before the change)https://github.com/contentful/experience-builder/assets/8539634/902c873d-0a55-4123-897d-68afebcf1951
With this change, only the sides with 0 padding or a pixel value less than 4px will be adjusted to 4px padding:
https://github.com/contentful/experience-builder/assets/8539634/6d3784b2-cf2d-4175-ad4c-c4b407e696ac
The purpose of this
addExtraDropzonePadding
method is to add a little padding when dragging, so that dropzones will activate in structure components that have children elements taking up the full size of the component.