Skip to content
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

Fix for Issue #57: Attempt to change hex code by typing results in #2NanNanNan #92

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

RasyadiAbdoellah
Copy link

Addresses #57. Changes the behaviour for the hex input so that the hex value will only change if the user tabs away from the input or if the user presses the enter key.

Added a local hexInput state that stores the input value for the hex text input. hexInput value also gets updated in a useEffect hook whenever the parent hex value changes.

Updating the parent hex value is moved to onBlur and OnKeyUp. A regex check was added to changeHex to ensure changeColor is only called if the hex value is valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant