Issue #2928Opened July 29, 2020by tranthanhhoa2 reactions

BUG: Select the initial background color doesn't work

Question

Version: 0.16.18

Bug: Select the initial background color is not working

How to reproduce it: https://imgur.com/xqkt46E

Actually:

  • Component's background does not changes.

Expected:

  • Component's background should change to #000000

Thanks @artf !

Answers (3)

mcottretJuly 29, 20202 reactions

Hi @tranthanhhoa & @RJCAM,

The bug indeed only appears when specifically selecting a background color value of #000000.

Tracking it down, it is due to the background-color property's default value of 'none' being set as '' by the color input. It later gets converted to #000000 by the color picker, whereas its actual value is rgba(0, 0, 0, 0) (or transparent).

The updated value is compared to the color picker's stored value on change, & nothing is done if they are equal (hence only failing when setting it to #000000).

I think this should be fixed by setting the background-color property's default value to transparent. Which should also allow to remove the special handling of the none value in the ColorInput.

As always, I'd be happy to open a PR if this looks good to you :).

RJCAMJuly 29, 20200 reactions

@tranthanhhoa I'm not able to reproduce this bug in the demo (same as you), it's working fine here, check this:

bg-color

What did you do before?

tranthanhhoaJuly 30, 20200 reactions

background-color property's default value to transparent worked for me. Thank you so much @mcottret !

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.