-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[BUG] width of the dcc.Input field does not scale properly when step=None #2791
Comments
HI @nadijagraca |
Hi Adam, Below you can find example code. If you replace
To replicate the bug you will need to use slider handle, and once the slider handle is dragged to the number with decimal place, you will notice that the decimal place is being cut-off from the input field. |
hi @nadijagraca I'm using Dash 2.16.1 on a Windows 11. And it worked fine on Firefox, Edge, and Brave. |
@Coding-with-Adam @nadijagraca I am seeing the issue on Mac in Safari and Chrome. No issue in Firefox because the box is wider overall in Firefox. I wonder what is causing the width difference between browsers. With Odd that the width of the box is affected by the value of Worth noting, though, that setting If I were to guess I would say |
After another look I see that So the answer here I think is
|
Thank you for the solution, @emilykl |
Describe your context
My environment:
Describe the bug
I have a
dcc.Input
component linked to thedcc.Slider
, the components sharemin
,max
,step
andvalue
properties. When I setstep=None
, and drag the slider handle to some value with decimal places, the decimal numbers are sometimes cut-off.Example screenshot below. (notice missing number after the comma)
Upon further investigation I found that this happens when step is set to
None
, and number of digits in thevalue
exceeds the number of digits of themax
property. In the example from the screenshot above I hadmax=2007
andstep=None
.Once I set step to be 0.5, the width of the input field scaled and displayed the number correctly.
Expected behavior
Since
step
was set toNone
, slider automatically calculated the step size of 0.5, but it did not take it into account when scaling the width of the input field. Ideally, the automatically calculated step size should be taken into account when scaling the width of the input field, in the same way as it is done when users explicitly set step size.Screenshots
If applicable, add screenshots or screen recording to help explain your problem.
The text was updated successfully, but these errors were encountered: