BUG: Resizing canvas makes componenents end up with wrong positions once exported with dmode 'absolute'
Question
GrapesJS version
- I confirm to use the latest version of GrapesJS
What browser are you using?
Microsoft edge 98.0.1108.56
Reproducible demo link
https://jsfiddle.net/473b2tah/1/
Describe the bug
The canvas resize is cool but does not take into account that one might be working with px offsets because of dmode which works with px offsets, meaning, the zoomed in canvas, does not reflect the exported index.html page. The entire right side is empty once exported because the images are never told to rescale to fit the exported version. So for example here the canvas is at 0.85 scaling, which means the images should be scaled up by 1.15 and all moved to the right accordingly but are instead stuck on the left, leaving a gap on the right of about 15%. The canvas size should be about 1632 pixels, meanwhile the export width is 15% higher, aka 1920. This is something that I think should be automated and should be fairly simple to implement...
Code of Conduct
- I agree to follow this project's Code of Conduct
Answers (2)
I have sort of found a workaround... Set the .gjs-frame-wrapper to the desired width in CSS and transform: translate (- x px, 0px) for the iframe in CSS. The Canvas is not the correct width then (slightly smaller) but everything seems to work fine nonetheless... I am not going to close the issue however, due to the fact, that it's due to the poor implementation of the author, who could fix this extremely easily, as outlined before.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #5334
BUG: Selection of custom component type not working in the canvas
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome, Opera, Edge, etc Reproducible demo...
Issue #4097
BUG: mousePosFetcher in resizer config & change:style listener not working
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Brave V1.34.81 Reproducible demo link http...
Issue #6096
BUG: Resizable Box Disappears on Component Reselection
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Reproducible demo link https://jsfi...
Issue #6695
BUG: Prevent default not working for edge
GrapesJS version [x] I confirm to use the latest version of GrapesJS What browser are you using? Edge 144.0.3719.92 Reproducible demo link...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.