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

Validate selection slider values #3365

Merged
merged 2 commits into from
Feb 1, 2022
Merged

Conversation

jasongrout
Copy link
Member

Ensure the slider values are valid. For the selection slider, this makes sure they are integer indices.

Fixes #3363

@jasongrout jasongrout added this to the 8.0 milestone Feb 1, 2022
@github-actions
Copy link

github-actions bot commented Feb 1, 2022

Binder 👈 Launch a binder notebook on branch jasongrout/ipywidgets/round

According to the nouislider docs, it returns values to 2 decimal places, and the place to make sure we have integers is in the to transformation function.

Fixes jupyter-widgets#3363
According to the nouislider docs, values are float by default, and you
must convert them as desired in the to function.

It seems that Math.round is more appropriate than Math.floor - the slider
value might be just below the appropriate value instead of just above.
Copy link
Member

@ibdafna ibdafna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

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.

SelectionSlider missing options, returns TraitError
2 participants