✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
πŸ“Š Dash 2.0 is Arriving. Register here.

Input type "number" increment issue

I am trying to have an input where the minimum value is close to 0 (but not 0). I have set the minimum to 0.0001. I have then set the step to 1 and the default value to 1.

Upon loading the input box has the number 1 in. When I press the up button however it goes to 1.0001. If I press again it goes to 2.0001.

If I remove the value and put 5 in and then increase by 1 it goes to 5.0001.
Am I missing some sort of property to make it do as I wish (https://dash.plot.ly/dash-core-components/input).

I just want to increase by 1 (or decrease by 1)

Can be seen here:

import dash_html_components as html
import dash_core_components as dcc
import dash
from dash.dependencies import Input, Output, State

import pandas as pd

app = dash.Dash()

app.layout = html.Div(
    dcc.Input(
        value=1,
        type="number",
        min = 0.0001,
        step = 1,
        max = 10,
    )
)

if __name__ == "__main__":
    app.run_server(debug=True)

Help would be greatly appreciated

Hm, that’s odd. I might just try using type="text" and then parse the number in your callback with float(value). Would you mind creating a bug report here? https://github.com/plotly/dash-core-components/issues/ thanks!

1 Like