inputRef.current.focus()}
102 | {...restContainerProps}
103 | >
104 |
{
110 | inputRef.current = node;
111 | if (typeof ref === "function") {
112 | ref(node);
113 | } else if (ref) {
114 | ref.current = node;
115 | }
116 | }}
117 | className={classNames("vi", inputClassName)}
118 | onKeyDown={handleKeyDown}
119 | onFocus={() => {
120 | setActive(true);
121 | onFocus?.();
122 | }}
123 | onBlur={() => {
124 | setActive(false);
125 | onBlur?.();
126 | }}
127 | onSelect={(e) => {
128 | const val = e.target.value;
129 | e.target.setSelectionRange(val.length, val.length);
130 | }}
131 | type={passwordMode ? "password" : inputType}
132 | {...restInputProps}
133 | />
134 | {[...Array(length)].map((_, i) => (
135 |
153 | {passwordMode && getValue()[i]
154 | ? passwordChar
155 | : getValue()[i] || placeholder}
156 |
157 | ))}
158 |
159 |
160 | >
161 | );
162 | },
163 | );
164 |
165 | VerificationInput.displayName = "VerificationInput";
166 |
167 | export default VerificationInput;
168 |
--------------------------------------------------------------------------------
/docs/_next/static/chunks/nextra-data-en-US.json:
--------------------------------------------------------------------------------
1 | {"/API":{"title":"API","data":{"":""}},"/migration/v2":{"title":"Migrating to Version 2","data":{"":"This guide is aimed at developers wanting to update from v0.1.x to v2.x.x.Check the following steps one by one and execute the ones that apply to your\nsituation.","rename-prop-input#Rename prop: input":"The input prop has been renamed to inputProps in order to be more explicit\nabout the props being forwarded to the input element. Also, the onChange\ncallback is now available on the top level. This matches the interface of a\nregular input element more closely (there is also a new top-level prop\nvalue).\n// v0.1.x\n