Skip to content

Bug with minLength #159

Description

@sergio-ivanuzzo

Hi there !

I've found a bug and this is a small example to reproduce:

import React, {useState} from "react";
import {DebounceInput} from "react-debounce-input";

const MIN_LENGTH = 4;

const App = () => {
    const [text, setText] = useState("");
    return (
        <>
            <DebounceInput value={text} onChange={(e) => setText(e.target.value)} debounceTimeout={250} minLength={MIN_LENGTH} />
        </>
    )
};

export default App;

when input value length is MIN_LENGTH all is OK, but after I press backspace (so length become less than MIN_LENGTH) the whole input value removes.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions