material-ui-color icon indicating copy to clipboard operation
material-ui-color copied to clipboard

Difficult to remove 'NaN' in ColorPicker RGB input

Open ConnorTimpe opened this issue 3 years ago • 2 comments

Describe the bug When inputting a value into the RGB input of the ColorPicker, if you enter a non numerical value, NaN is displayed in the input field. You are then unable to type in that input until you select a color from a different input method.

To Reproduce Steps to reproduce the behavior:

  1. Open the ColorPicker.
  2. In any of the RGB input fields, type a letter or symbol (ex: 'A')
  3. NaN should appear
  4. Attempt to enter a new value into the same RGB input field

Expected behavior After entering an incorrect value into an RGB field, a warning should pop up (similar to the ones present on the hex input field). You should still be able to type in the RBG field and backspace to delete the entered text.

Screenshots image

ConnorTimpe avatar Dec 01 '21 22:12 ConnorTimpe

Nice catch I work on a fix

mikbry avatar Dec 05 '21 18:12 mikbry

This package (https://viclafouch.github.io/mui-color-input/) handles this problem, supports both React 17 / 18 and MUI V5

viclafouch avatar Aug 29 '22 10:08 viclafouch