Replies: 2 comments 1 reply
-
@artf Could you please help this one?
|
Beta Was this translation helpful? Give feedback.
1 reply
-
you can also do it like this // for every component dragged to canvas
editor.on('canvas:dragend', (dt) => {
const comp = editor.current?.Canvas.getLastDragResult();
if (comp?.is('image')) {
comp?.setStyle({ width: '100%' }); // add other stylings if you like
}
}); if you're using React and inits inside the useEffect, it should look like this useEffect(() => {
editor.current = grapesjs.init({
// ...
});
editor.current?.on('canvas:dragend', (dt) => {
// ...
});
}, []); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When I drag an image block into the editor, I want the default width of the image to be 100%, not auto.

Beta Was this translation helpful? Give feedback.
All reactions