Search code examples
htmlgoogle-chromeinputcolorschromium

input[type=color] with predefined values not working since chromium 107


I have an input[type=color] with some predefined values:

<datalist id="5sui88f">
  <option>#1973ff</option>
  <option>#7F23FF</option>
  <option>#ff4136</option>
  <option>#ff851b</option>
  <option>#ffeb10</option>
  <option>#00db60</option>
</datalist>

<input type="color" list="5sui88f" id="picker">

Fiddle: https://jsfiddle.net/ds0kax25/1/

In Chromium based browsers, this results in a nice list of predefined colors to choose from:

color dropdown in chrome

This worked completely fine in older Chromium versions. However, since Chromium 107 selecting any value from the predefined list always sets rgba(0, 0, 0, 0) as the value of the input which isn't even a valid value for a color input.

In Chromium 106 this works without any problems. What am I doing wrong?


Solution

  • This is a Chromium bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1380977

    I just checked it in Chrome 109 and it seems to work fine there.