contentful / experience-builder

https://www.contentful.com/developers/docs/experiences/what-are-experiences/
MIT License
5 stars 1 forks source link

fix(visual-editor): extra dropzone padding when dragging [ALT-746] #575

Closed primeinteger closed 4 weeks ago

primeinteger commented 4 weeks ago

Purpose

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)

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.

vercel[bot] commented 4 weeks ago

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

Name Status Preview Updated (UTC)
experience-builder-test-app ✅ Ready (Inspect) Visit Preview Apr 19, 2024 8:15pm