Issue #1991💬 AnsweredOpened April 29, 2019by afdallah2 reactions

Resizable, using unitWidth in px output into percent.

Quick answerby artf1

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)

artfMay 1, 2019

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...

afdallahMay 2, 2019

You are the man!!! 👍 👍 Thank you so much @artf.

artfMay 1, 2019

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.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

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.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.