react-code-input
react-code-input copied to clipboard
Placeholder?
Is there any way to add a placeholder (ex: "-") for the input fields?
not yet possible, but could be useful feature
import ReactCodeInput from "react-code-input";
export default function ExampleComponent({}: {}) {
...
const inputRef = useRef<any>(null)
useEffect(() => {
if (null !== inputRef.current){
document.querySelectorAll("input")
.forEach((node: HTMLInputElement) => node.setAttribute('placeholder', '0'));
}
})
return (
...
<ReactCodeInput
ref={inputRef}
fields={4}
name="pin"
type="text"
inputMode="latin"
/>
...
)}