Skip to content

Difficult to remove 'NaN' in ColorPicker RGB input #189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ConnorTimpe opened this issue Dec 1, 2021 · 2 comments
Open

Difficult to remove 'NaN' in ColorPicker RGB input #189

ConnorTimpe opened this issue Dec 1, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@ConnorTimpe
Copy link

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

@mikbry
Copy link
Owner

mikbry commented Dec 5, 2021

Nice catch I work on a fix

@mikbry mikbry added the bug Something isn't working label Dec 5, 2021
@viclafouch
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants