nkbt / react-debounce-input

React component that renders Input with debounced onChange
MIT License
450 stars 61 forks source link

Is there a backstory behind `minLength` not passing through to `<input>`? #155

Open tony opened 2 years ago

tony commented 2 years ago

Is it by design that minLength doesn't pass through to <input>?

TypeScript: lib.dom.ts for HTMLInputElement HTML: minlength for HTMLInputElement on MDN

My supposition is that in React minLength (react) -> minlength (HTML)

Sandbox: https://codesandbox.io/s/react-18-playground-react-debounce-input-case-8pln0b?file=/src/index.tsx

nkbt commented 2 years ago

Yeah minLength is used internally because I tried to make component a drop in replacement.

The main issue is that underlying component does not have to be an input. Could be a textarea or anything else. And it does not support minLength attribute and will throw warning about it.

tony commented 2 years ago

@nkbt Suggestion for what we do next? Should we consider this closed as a wontfix since the underlying component is unknown? Is there an approach for a PR potentially?