Skip to content

Infinite increasing if disable and readOnly input right after the click. #112

Open
@vitpankin

Description

@vitpankin
    onMouseDown(dir: "up"|"down", callback?: Function): void
    {
        if (dir == 'down') {
            this.decrease(false, callback);
        }
        else if (dir == 'up') {
            this.increase(false, callback);
        }
    }

after click in increase call you set a looping increase call for a long press as I understood

        if (isNaN(this.state.value) || +this.state.value < _max) {
            this._timer = setTimeout(() => {
                this.increase(true);
            }, _recursive ? NumericInput.SPEED : NumericInput.DELAY);
        }

but sometimes in complex forms I have to get new data from API and there's a need to disable Field until getting a response. So if I set input props disable or readOnly to true right after click (which is pretty common I believe not only for my case) input doesn't stops interval and it starts to increasing value infinitely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions