Fluentui: ColorPicker - changing text values is not reflected in component state

Created on 16 Mar 2017  路  4Comments  路  Source: microsoft/fluentui

  • __Package version(s)__: v2.5.0
  • __Browser and OS versions__: all (n/a)

Priorities and help requested (not applicable if asking question):

Are you willing to submit a PR to fix? (Possibly?)

Requested priority: Normal

Describe the issue:

In the <ColorPicker> component there are Textareas beneath the palette and sliders which show the hex, R, G, B and A values.
These Textareas are not read-only, so one would expect that changing the values manually here would be reflected in the state of the ColorPicker (e.g. pasting a known hex value would make the picker jump to the appropriate point in the swatch.

Actual behavior:

Changing text values in the color picker does not alter the color as expected.

Expected behavior:

Selector point in the swatch should jump to the appropriate color.

Other notes:

  1. Being able to edit the Textareas I would consider to be a bug. Making these Texaeras read-only would be a sensible fix.
  2. I guess the ability to manually edit the Textareas here should be considered a feature request.

Many thanks!

Design 馃帹

Most helpful comment

I have a PR out, the entire control should now update to the correct values when any other part of the control changes, which means changing a text field value will update the swatch and sliders.

All 4 comments

Thanks for explaining the issue in details but I would still want to keep the hex text area editable. There are users that uses that and change is reflected in color palette. For RGB and A, we should make them read- only if no users are using them.

@mdahamiwal is that really the case?

http://dev.office.com/fabric#/components/colorpicker I change the hex values here and the colour doesn't change at all. See screenshot:

image

There seems to be no reason to have these values editable if editing them does nothing.

That's right, I misunderstood the visible (hex) with the prop change (color) that we handle gracefully. I am okay with having all the text inputs as uneditable or render labels instead of text boxes to improve accessibility.
@mikewheaton, thoughts ?

I have a PR out, the entire control should now update to the correct values when any other part of the control changes, which means changing a text field value will update the swatch and sliders.

Was this page helpful?
0 / 5 - 0 ratings