Issue #2366đź’¬ AnsweredOpened November 1, 2019by benvmatheson1 reactions

Text-shadow removes rgb values when element selected

Quick answerby benvmatheson❤ 1

It looks like targetUpdated is run twice when the element is clicked. Once with the correct value rgb(89, 89, 89) 5px 6px 7px and a second time with rgb cleared 0 5px 6px 7px. This would explain why it's confused whether the first or last number should be interpreted as the color. Any ideas where this second run would...

Read full answer below ↓

Question

Example: https://jsfiddle.net/benvmatheson/g1ft06qh/8/

Import a style with a text property. text-shadow:rgb(51, 166, 58) 4px 4px 4px;

This works correctly, and the item is displayed correctly. However, once the item is selected, the rgb value is dropped and replaced with 0. text-shadow:0 4px 4px 4px;

Answers (3)

benvmatheson• November 9, 2019

It looks like targetUpdated is run twice when the element is clicked. Once with the correct value rgb(89, 89, 89) 5px 6px 7px and a second time with rgb cleared 0 5px 6px 7px. This would explain why it's confused whether the first or last number should be interpreted as the color. Any ideas where t...

artf• November 2, 2019

Yeah, I'm already aware of this issue. Unfortunately, the Style Manager parser is quite dumb and what it does is simply splitting the value by a separator, in this case ' ' (space), and distributing splits to relative properties by their order in the definition. So, technically, this change would m...

benvmatheson• November 4, 2019

This seems like it could turn into a big project due to cross browser dependencies. Would it be worth bringing in a 3rd party module instead of trying to solve this inside grapes?

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.