GrapesJS / mjml

Newsletter Builder with MJML components in GrapesJS
http://grapesjs.com/demo-mjml.html
BSD 3-Clause "New" or "Revised" License
645 stars 229 forks source link

BUG: Borders missing after dropping components over it #338

Closed gustavohleal closed 2 months ago

gustavohleal commented 1 year ago

Hi!

We have found this bug that is removing the border from columns when you drop components into it specifically over the border drawing even with the sorter indicating the right place. The strangest thing is that it only removes the border from the view. If you open the styles panel the values are still there and if you change anything it will re-render and it works again. And if you open the export-code modal or check the view by inspecting the elements it still has the border attributes as mjml standards.

All of this was tested in the demo and only happens in the mjml editor.

Here is the expected behavior. The block dragged is being dropped in the center of the column and then added normally.

Screencast from 23-10-2023 11:38:36.webm

But here is the current behavior. The block is being dragged over the column but is dropped over the border itself. The sorter is still indicating the bottom of the column the way it was suppose to. In this case i added border-radius so it is possible to see that after the border disappears the radius is still there. Then I changed 1px in the border-width and the border comes back as it was.

Screencast from 23-10-2023 11:40:14.webm

I have put debuggers in every function of the core and column model and view to see what was being triggered. Checked sorter and canvas events to see if it was getting some target wrong and nothing. I'm current trying to pass over the entire drop component cycle from grapes but still with no success.

If someone has any ideas or directions for where to keep debugging in the grapes cycle from the moment it drag over, drop the component to the moment it is rendered i would appreciate the help.

Thanks.

artf commented 3 months ago

Here is the culprit, not sure why but it was there from the beginning of the file... I'll remove it as I don't see any valid reason behind it.