Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

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

Closed

Description

@radekwlsk

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.

Activity

  1. sobayed commented on Jun 25, 2018

    @sobayed

    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).

  2. Austin-PAVrus commented on Oct 29, 2018

    @Austin-PAVrus

    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...

  3. valentijnnieman commented on Nov 5, 2018

    @valentijnnieman
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions