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

Slider: can't type in random number if the min value is not 0 #3107

Closed
q1401030115 opened this issue Jun 19, 2019 · 14 comments · Fixed by #5712
Closed

Slider: can't type in random number if the min value is not 0 #3107

q1401030115 opened this issue Jun 19, 2019 · 14 comments · Fixed by #5712
Labels
status: inactive Will close if there's no further activity within a given time

Comments

@q1401030115
Copy link

For the Slider component, I set the min to a non-zero value(10 for example). Then if I want to input a value 20, 30, 40, etc, the value will be set to other value and I can't input my needed value. Also, if I want to delete the value in the textbox, it could be set to the min value.

image

@emyarod
Copy link
Member

emyarod commented Jun 19, 2019

would you mind creating a Code Sandbox that illustrates the issue you are facing?

@stale
Copy link

stale bot commented Jul 19, 2019

We've marked this issue as stale because there hasn't been any activity for a couple of weeks. If there's no further activity on this issue in the next three days then we'll close it. You can keep the conversation going with just a short comment. Thanks for your contributions.

@stale stale bot added the status: inactive Will close if there's no further activity within a given time label Jul 19, 2019
@stale
Copy link

stale bot commented Jul 22, 2019

As there's been no activity since this issue was marked as stale, we are auto-closing it.

@stale stale bot closed this as completed Jul 22, 2019
@q1401030115
Copy link
Author

q1401030115 commented Aug 9, 2019

@emyarod Look at the component below:
image

Now, If I want to input the value 25, it just change to 105:
image

Also, I can't delete the value and leave the input box blank which is not good.

@tw15egan
Copy link
Collaborator

tw15egan commented Aug 9, 2019

Can you link to the CodeSandbox you are referencing?

@asudoh
Copy link
Contributor

asudoh commented Aug 16, 2019

^ It's the link of the CodeSandbox we provide, could you please put the link to yours?

@q1401030115
Copy link
Author

@asudoh I'm sorry, but I can't understand how should I provide my codesandbox to you? I just copy the link and paste here. Could you tell me the way to provide it?

@asudoh
Copy link
Contributor

asudoh commented Sep 25, 2019

You can click on the fork button that gives you a new URL. That's when you can start putting your stuff.

@ucbdiaz2015
Copy link

I can reproduce this issue with carbon-components v10.10.1 and carbon-components-react v7.10.1.

Seems to be fixed in 10.10.2 and 7.10.2, but that has another issue where typing in a number sets anything less than min to min*2 and anything above that to input + min.

I've also seen issues with this version where the value changed on its own each time the component was mounted (probably related to the previous issue).

And another issue with this version setting state too many times when the component mounts, causing my react app to crash.

Here is my sandbox where you can view behavior of the two versions I mentioned above: https://codesandbox.io/s/sleepy-morse-qt1bz

@asudoh
Copy link
Contributor

asudoh commented Mar 26, 2020

Seems that there is a recent regression, reopening.

@asudoh asudoh reopened this Mar 26, 2020
asudoh added a commit to asudoh/carbon-components that referenced this issue Mar 26, 2020
This change ensures that `<Slider>` won't force changing the value that
user types in the `<input>`. For example, if we set 3 to `min` and user
wants to type 100 in the `<input>`, this change ensures `<input>` won't
become 3 (the minimum value) as soon as user types 1 (the first
character in 100).

Fixes carbon-design-system#3107.
asudoh added a commit that referenced this issue Mar 26, 2020
This change ensures that `<Slider>` won't force changing the value that
user types in the `<input>`. For example, if we set 3 to `min` and user
wants to type 100 in the `<input>`, this change ensures `<input>` won't
become 3 (the minimum value) as soon as user types 1 (the first
character in 100).

Fixes #3107.
@hongcbjch
Copy link

@asudoh I met this same issue,may I know which carbon version includes the fix? Thanks.

@tw15egan
Copy link
Collaborator

@hongcbjch looks like any version above 7.11.0

@hongcbjch
Copy link

@tw15egan Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: inactive Will close if there's no further activity within a given time
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants