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

Input 'number' with min and max not checking manual input #173

Closed
radekwlsk opened this issue Mar 12, 2018 · 3 comments

Comments

Projects
None yet
4 participants
@radekwlsk
Copy link

commented Mar 12, 2018

The dcc.Input component set to type='number' with min and max defined checks the value only when using the input's arrows. On manual input any value can be entered, only regexp for number is checked.

I think it should apply min when entered manually value is lower than allowed and max when it is greater than allowed. For example on focus lose or mouse click or even after some delay of not typing.

@sobayed

This comment has been minimized.

Copy link

commented Jun 25, 2018

I agree. When I saw the min/max parameters I assumed that the user inputs would be checked in some way. Allowing any input anyway kind of defeats the purpose (or at least make the forced check configurable).

@Austin-PAVrus

This comment has been minimized.

Copy link

commented Oct 29, 2018

Me too. Trying solve it by making something like:

@app.callback(Output('agentT', 'value'),
[Input('agentT', 'value')],
[State('agentT', 'min'),
State('agentT', 'max')])
def check_agentT_value(val,min,max):
if val >= min or val<= max:
raise PreventUpdate
elif val<min:
return min
else:
return max

leads me to a failure of layout loading with no logs in the console...

Are there other ways to check the limits of a manual input? I have 46 numeric fields in my project...

@valentijnnieman

This comment has been minimized.

Copy link
Contributor

commented Nov 5, 2018

A fix is included in 0.37.0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.