SAP / openui5

OpenUI5 lets you build enterprise-ready web applications, responsive to all devices, running on almost any browser of your choice.
http://openui5.org
Apache License 2.0
2.92k stars 1.23k forks source link

Color Palette Popover and Color Picker not showing selected color in a user-friendly way #4022

Closed icostaykov closed 3 months ago

icostaykov commented 3 months ago

OpenUI5 version: 122

Browser/version (+device/version): Chrome/123.0.6312.106 Win11

Any other tested browsers/devices(OK/FAIL):

URL (minimal example if possible):

  1. https://sapui5.hana.ondemand.com/sdk/#/entity/sap.m.ColorPalette/sample/sap.m.sample.ColorPalettePopover
  2. https://sapui5.hana.ondemand.com/#/entity/sap.ui.unified.ColorPicker/sample/sap.ui.unified.sample.ColorPickerPopover

Steps to reproduce the problem:

  1. Color palette popover

    1. Open color palette popover
    2. Select a color
  2. Color Picker

    1. Open color picker dialog
    2. Select a color

What is the expected result?

  1. the icon of the button changes to the selected color
  2. inside the "input" field, there is somewhere something that changes its color to the selected one

What happens instead?

  1. A toast message with the hex string of the selected color appears (not user friendly)
  2. The text in the input field changes to the hex string of the selected color (not user friendly)

Any other information? (attach screenshot if possible) image image

niyap commented 3 months ago

Hello @icostaykov,

Thank you for sharing this finding. I've created an internal incident DINC0116436. The status of the issue will be updated here in GitHub.

Regards, Niya

icostaykov commented 3 months ago

I'm glad to hear you are already working on it!

Meanwhile, if anybody else has this issue, a workaround can be found - if instead of a button with icon, you just use an icon, you can color it any way you like - <core:Icon id="colorPaletteButton" src="sap-icon://color-fill" color="<yourDefaultColor>" press="<yourHandler>" />. It doesn't look as good, but works.

NHristov-sap commented 3 months ago

Hi @icostaykov ,

We have discussed your proposals with the design colleagues, and unfortunately we will not implement them in the controls. Let me explain:

the icon of the button changes to the selected color inside the "input" field, there is somewhere something that changes its color to the selected one

for both cases the statement is that controls (Button and Input) can have semantic states assigned, and adding/changing color of background, icon or something else will lead to inconsistent view; in addition, there are cases when the colored element can be iundistinguishable from the background of the control(s).

The current situation: A toast message with the hex string of the selected color appears (not user friendly) The text in the input field changes to the hex string of the selected color (not user friendly)

This is being done that way just to demonstrate that there is an event that is being fired, and inside you have some data as parameters, so this data is visualized in some way. The developer can implement another functionality, including the proposed change of the icon/background/etc. This is not recommended by our design guidelines, but if the developer wants to neglect our recommendations, the requested functionality can be still implemented.

Best Regards, Nikolay Hristov UI5 Developer