Issue #373Opened October 4, 2017by sonnylloyd0 reactions

Color input does not update the element on page

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)

sonnylloydOctober 4, 20170 reactions

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

sonnylloydOctober 5, 20170 reactions

@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 these, just above the IF statement and changed the variable previousСolor so it can be accessed by all the functions.

model.set('value', valueClr);
colorEl.spectrum('set', valueClr);

if (opts.targetUpdate) {
      self.previousСolor = valueClr;
      this.noneColor = valueClr;
}

again this feels a little hacky im not sure if its the correct approach.

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.