Skip to content

[Bug Report][3.11.8] VColorPicker RGB handling #22567

@antoinematyja

Description

@antoinematyja

Environment

Vuetify Version: 3.11.8
Vue Version: 3.5.27
OS: macOS 10.15.7 (current)

Steps to reproduce

  1. Create a VColorPicker (or VColorInput which creates a VColorPicker)
  2. Set its value to a rgb string, for example rgb(102, 187, 106)
  3. Click on a swatch color or in the gradient to select another color

Expected Behavior

It should set a valid css value

Actual Behavior

It applies a broken value like rgb(233 30 99 / undefined)

Reproduction Link

https://play.vuetifyjs.com/#...

Other comments

The color picker is fine when working with hex values.
The issue only happens when the value is set to a rgb string like rgb(102, 187, 106), from what I understand it parses an alpha value as undefined, but then when we pick a color, it generates a string with modern syntax and puts undefined as alpha.
I tried to look at the code and saw that the parseColor util handles it correctly: https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/util/__tests__/colorUtils.spec.ts#L47
So I guess the issue is rather with the color picker component applying the selected color.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: VColorPickerT: bugFunctionality that does not work as intended/expectedgood first issueA quick-win fix that would be great for new contributors

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions