Issue #5040Opened April 10, 2023by abubaker4170 reactions

BUG: added style able events such that styling can be overwritten, open

Question

GrapesJS version

  • I confirm to use the latest version of GrapesJS

What browser are you using?

Version 111.0.5563.147 (Official Build) (64-bit)

Reproducible demo link

I provided code

Describe the bug

added styleable events such that styling can be overwritten https://github.com/GrapesJS/grapesjs/issues/1041 https://github.com/GrapesJS/grapesjs/pull/1056 @tommedema , @artf can you check this, please

I'm using this logic for a style overridden

editor.on('styleable:change', (model, property) => {
        const value = model.getStyle()[property];
        if (value.indexOf('!important') === -1) {
          model.addStyle({ [property]: value + ' !important' });
        }
});

with this functionality, style is overriding the first time, and on the second time when I remove the style from style-manager and then add it again so it is not working and does not get any style.

once I refresh then active again and can add style only one time

Code of Conduct

  • I agree to follow this project's Code of Conduct

Answers (0)

No answers yet.

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

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.