Issue #2360💬 AnsweredOpened October 30, 2019by MartinPutz1 reactions

How to add a new property type(integer) to StyleManager?

Quick answerby MartinPutz1

You were right, it works now. Thanks a lot. Great project!

Read full answer below ↓

Question

Hi, I am trying to create a custom StyleManager property with 'integer' type. My ultimate goal is to 're-define' how certain units are displayed. For example, the user use unit 'X' and then the actual value would be different in pixels.(One of the reasons is the new dragmode since it is using pixels, so I want to keep all values in pixels but would allow the user to use other units). I've checked the available functions and by extending the 'integer' number input I should be able to achieve that. But I get an error when I try to extend the 'integer' type. The code I tried: This gives an error...

Answers (2)

MartinPutzNovember 3, 2019

You were right, it works now. Thanks a lot. Great project!

artfNovember 2, 2019

Actually, the integer property has a wrong implementation of init (I'll fix it in the next release). For now, update your init method with the code below and try if it works

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 →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.