Resizable, using unitWidth in px output into percent.
Ah wait, my fault, opts is the 3rd one updateWidth(model, value, opts = {}) { btw the second argument in setStyle are options (eg, { silent: true } to avoid triggering change listeners) and you get those options also in the callback of your listeners so I just placed a custom key fromPxToPerc to know when the change i...
Read full answer below ↓Question
Hi @artf, Thanks for making this amazing framework. Recently I made a custom component based on your flexbox plugin. The red arrow is the actual value of the model. The green arrow is what I expected to be. Is that possible to set unitWidth as px but the output to be percent? Here is what I've triedI separated them as 2 component, grid component, only as a container that will then I set the display into flex, column component, which I put the resizable.set resizable Makes the column listen to the resizing event. (I am not sure if this was correct, I might need to make a new different post for...
Answers (3)
Ah wait, my fault, opts is the 3rd one updateWidth(model, value, opts = {}) { btw the second argument in setStyle are options (eg, { silent: true } to avoid triggering change listeners) and you get those options also in the callback of your listeners so I just placed a custom key fromPxToPerc to kn...
You are the man!!! 👍 👍 Thank you so much @artf.
Hi @afdallah, from the resizer point of view you'd need to use updateTarget option to customize the target but unfortunately, you can't as it already heavily used by the SelectCommand So I'd ask you to try to use this in your updateWidth function to avoid the infinite loop:
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1113
[QUESTIONS] New trait type is not working with rendered components?
Hello, thanks for the great framework. I'm trying to apply this to my project. I want to add a new trait for existing LINK '<a>' component....
Issue #1690
Flexbox icons missing in the distribution, but demonstrated in the grapesjs.com demo page.
Hi, It appears that the icons / images for the flexbox properties are missing (row, column, etc). These icons are present on the demo page...
Issue #444
How to load css link into the head tag?
Hello, First of all, thanks for contributing such an amazing js framework. I am very new to grapesjs. And github too. https://github.com/ar...
Issue #827
[QUESTION] Change location of command panel
Amazing library, thank you!! I have two questions I'm hoping you can help with.How can I move the command panel from the top to the left as...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.
Browse premium plugins →Related tutorials
In-depth guides on the same topic.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.