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

EditableInput component can't accept 0% & 1% values. #707

Closed
pizza3 opened this issue May 2, 2020 · 0 comments · Fixed by #709
Closed

EditableInput component can't accept 0% & 1% values. #707

pizza3 opened this issue May 2, 2020 · 0 comments · Fixed by #709

Comments

@pizza3
Copy link
Contributor

pizza3 commented May 2, 2020

There is an issue in the EditableInput component, if I try to set s, l, or v in hsl or hsv to 0% or 1% the saturation pointer seems to always jump towards 100% when the input box focuses out.
On removing the focus from the input box it changes from 1% to 100%, this issue only arises when we set 1% or 0% values to the s,l, or v input's.

On further debugging I found out over here at line 80 , the value of s can never be 0 because 0 || (n>0) = n therefore the statement at line 80 could be something like this s: Number( !_.isUndefined(data.s)? data.s : this.props.hsl.s ), over here we can check if data.s isn't undefined and then assign it to the value of s key.

A small demo of the existing issue.
Kapture 2020-05-02 at 20 02 46

@pizza3 pizza3 changed the title EditableInput component can't except 0% & 1% values. EditableInput component can't accept 0% & 1% values. May 3, 2020
casesandberg added a commit that referenced this issue May 3, 2020
whitefog425dev added a commit to whitefog425dev/react-color that referenced this issue Jun 13, 2023
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 a pull request may close this issue.

1 participant