SAP / ui5-webcomponents

UI5 Web Components - the enterprise-flavored sugar on top of native APIs! Build SAP Fiori user interfaces with the technology of your choice.
https://sap.github.io/ui5-webcomponents/
Apache License 2.0
1.51k stars 263 forks source link

[ui5-color-palette-popover]: ColorPicker does not take the last selected color from palette #8772

Open henriquemattos opened 5 months ago

henriquemattos commented 5 months ago

Bug Description

Hi, team.

If I select a color in the palette (from default colors or from recent colors) and then I choose to open More Colors..., the ColorPicker has the last used color of the Picker, not from the Palette. If no color has been selected in the Picker, then white is predefined.

Affected Component

No response

Expected Behaviour

Selecting colors in the palette would reflect in the picker when choosing "More Colors..."

Isolated Example

No response

Steps to Reproduce

  1. Add ui5-color-palette-popover with showRecentColors, showMoreColors and showDefaultColor;
  2. Define some IColorPaletteItem in the default slot;
  3. Select a color from the palette;
  4. Choose More Colors... to open the ColorPicker;
  5. Check that white is predefined, or the last picked color is used, but not the last palette color selected.

Log Output, Stack Trace or Screenshots

No response

Priority

Medium

UI5 Web Components Version

1.20

Browser

Chrome, Edge, Safari

Operating System

No response

Additional Context

No response

Organization

SAP Event Ticketing

Declaration

dimovpetar commented 5 months ago

Hello @henriquemattos ,

So you would expect that the "More Colors" picker shows the last selected color in the color palette? https://stackblitz.com/edit/js-ibapyk?file=index.html

Best regards, Petar

henriquemattos commented 5 months ago

Hi, @dimovpetar . I would expect the Color Picker to show the last used color (blue, shown in the color palette in background):

Screenshot 2024-04-17 at 11 50 36

dimovpetar commented 5 months ago

Hello @ui5-webcomponents-topic-b,

Please evaluate this feature request.

Best regards, Petar

DMihaylova commented 5 months ago

Hi @henriquemattos,

Could you please share more about your use case - why would you need the Color Picker to show the last chosen color from the Color Palette?

henriquemattos commented 5 months ago

Hi. Sure, here's my 2 cents:

Short answer is "because the ColorPicker in this case is an extension of the ColorPalette and as a user I would expect the data to be synchronized".

But let's say I choose blue from the palette and realize that with my background and other colors, the contrast is not enough, so I want to adjust RGBA manually for this color. If I don't have the RGBA/HEX from the palette, and the picker open with white, I would have to start from blank, in this case, literally.

Hope that helps. Cheers, Henrique

DMihaylova commented 5 months ago

Thank you @henriquemattos!

The request is now internally logged as FIORITECHE1-8168, and we'll promptly notify you once it's been addressed.

Regards, Diana