-
Notifications
You must be signed in to change notification settings - Fork 950
Interactive fails for non-zero decimal default argument #3102
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
Comments
Also, the initial values of the sliders are not the default values of the function's parameters. Is that expected? |
cc @ibdafna |
It's not specific to from ipywidgets import FloatSlider
FloatSlider(value=1.5, description='zeta', min=-1.5, max=4.5) |
@davidbrochart I see you self assigned, let me know if you need help! |
For now I have no idea what's going on, so no problem if you want to look into it too 😄 |
I can see that here:
we have values = [NaN] . Where is this value set?
|
I've done some tests and this combination of parameters seems to fail noUiSlider at the source😱. You can see the issue here; open the console and try dragging the slider: https://jsfiddle.net/itayd/aoL43yn8/2/ Removing the built-in format function does seem to solve the problem, but we rely on it for float precision...I'll need to dig deeper to find a suitable fix. |
It is because here: ipywidgets/packages/controls/src/widget_int.ts Lines 217 to 220 in c46e5dc
from receives a string and should return a number. If you replace with the following it works fine:
from: (value) => Number(value), I'll open a PR. |
Description
On master if you have a default argument that has a non-zero decimal then

interactive
will fail to generate a slider.This appears to be a regression from the
7.x
branch.Reproduce
Jupyter Log Console
Expected behavior
A working slider is generated
Context
The text was updated successfully, but these errors were encountered: