spectrum-web-components icon indicating copy to clipboard operation
spectrum-web-components copied to clipboard

[Bug]: Can not get initial value of sp-color-slider without assigning color first

Open davidkudera opened this issue 3 years ago • 2 comments

Code of conduct

  • [X] I agree to follow this project's code of conduct.

Impacted component(s)

color-slider

Expected behavior

color property of ColorSlider should return the default value even when no color was previously assigned.

Actual behavior

color returns the message "No color format applied.". This behavior is different from ColorArea which returns ff0000 (initial state).

Screenshots

No response

What browsers are you seeing the problem in?

Chrome

How can we reproduce this issue?

  1. Go to https://studio.webcomponents.dev/edit/gXmv8TiE97lhOhzezr4p/
  2. See that area has an initial value and the slider doesn't

Sample code that illustrates the problem

No response

Logs taken while reproducing problem

No response

davidkudera avatar May 24 '22 10:05 davidkudera

ColorWheel behaves in the same way, so maybe ColorArea has a bug and should return "No color format applied." when no color was assigned.

davidkudera avatar May 24 '22 13:05 davidkudera

It does appear that Color Area is the one missing this "no format" return, which points to you being right. However, we do want to ensure that users are able to get a quality experience from our elements regardless of their input. This might make a good addition to #2308 where we could have DEV MODE warn on this reality but still return a color to ensure that applications "just work". Thanks for submitting this!

Westbrook avatar May 25 '22 01:05 Westbrook