grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

Resize blocks with mouse?

Open matthewgertner opened this issue 9 years ago • 4 comments

I noticed that in the current demo it is only possible to resize most blocks using the property editor, not by dragging anchors on the block (which is possible with the map element for example). Is this by design or is it simply a feature that has not been implemented yet?

matthewgertner avatar Nov 24 '17 15:11 matthewgertner

Hi @matthewgertner,

I believe this is can be enabled on individual components via the "resizable" property: component.set("resizable", true). It's probably not going to work very well on elements having a display: inline style (a <span> for example), or elements where the height/width is set by % instead of pixels.

This is probably not the best way to enable this, but you could do something like this to see it in action: editor.on("component:selected", function(args) { args[1].set("resizable", true); });

ryandeba avatar Nov 24 '17 18:11 ryandeba

@matthewgertner Ryan's solution should work, and, yes, I do not apply them by design for reasons already explained by Ryan but you can actually create blocks/components with resizable enabled

artf avatar Nov 28 '17 12:11 artf

@ryandeba @artf Great, thanks for the suggestion. We're playing with the codebase now so we'll give that a try.

matthewgertner avatar Nov 28 '17 15:11 matthewgertner

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Sep 18 '19 06:09 lock[bot]