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

Allow user to set value for slider. #307

Merged
merged 1 commit into from
May 26, 2024
Merged

Conversation

richard-to
Copy link
Collaborator

This change allows the value to be set for the slider. The implemented behavior here is similar to the input/textarea value field.

The value will update the value of the slider only if the value being passed in changes.

This is for the following use cases:

  1. Setting an initial value
  2. Updating the value programmatically. For example if you wanted a textbox to control the slider value
  3. Only updating the value if it changes, allows the slider to move smoothly (same issue as the text inputs)

Fixes #241

@richard-to richard-to force-pushed the slide-value branch 2 times, most recently from 527ba30 to 3ec45e0 Compare May 25, 2024 16:43
mesop/components/slider/slider.ts Outdated Show resolved Hide resolved
This change allows the value to be set for the slider. The implemented
behavior here is similar to the input/textarea value field.

The value will update the value of the slider only if the value being
passed in changes.

This is for the following use cases:

1. Setting an initial value
2. Updating the value programmatically. For example if you wanted a
   textbox to control the slider value
3. Only updating the value if it changes, allows the slider to move
   smoothly (same issue as the text inputs)
@richard-to richard-to merged commit 7302e44 into google:main May 26, 2024
3 checks passed
@richard-to richard-to deleted the slide-value branch June 6, 2024 14:22
wwwillchen pushed a commit to wwwillchen/mesop that referenced this pull request Jun 14, 2024
This change allows the value to be set for the slider. The implemented
behavior here is similar to the input/textarea value field.

The value will update the value of the slider only if the value being
passed in changes.

This is for the following use cases:

1. Setting an initial value
2. Updating the value programmatically. For example if you wanted a
   textbox to control the slider value
3. Only updating the value if it changes, allows the slider to move
   smoothly (same issue as the text inputs)
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.

Can't set starting value for slider component
2 participants