Issue #373πŸ’¬ AnsweredOpened October 4, 2017by sonnylloyd0 reactions

Color input does not update the element on page

Quick answerby sonnylloyd

@art i think the issue here is that inside function setValue(val, opts = {}) of InputColor.js does not call the change event inside spectrum. looks like it needs to be separated out.

Read full answer below ↓

Question

when using the color picker everything works fine.

however if you add a hex value to the input and press enter the color preview updates but the color is not applied to the element on the page

Answers (3)

sonnylloydβ€’ October 4, 2017

@art i think the issue here is that

colorEl.spectrum('set', valueClr);

inside function setValue(val, opts = {}) of InputColor.js does not call the change event inside spectrum. looks like it needs to be separated out.

sonnylloydβ€’ October 5, 2017

@artf i have been looking at this quite a bit and managed to get it working but the way i have done it seems a little hacky. The issue i found was inside src\domain_abstract\ui\InputColor.js inside setValue(val, opts = {}). the value opts.targetUpdate is undefined after the second loop. I added the...

artfβ€’ October 5, 2017

@sonnylloyd actually the real issue is here https://github.com/artf/grapesjs/blob/dev/src/domain_abstract/ui/Input.js#L24-L27 should be instead: I've already made this change in the latest RC, you can see it working here http://grapesjs.com/demo-no-jq.html

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.