You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 3, 2024. It is now read-only.
By default you can type anything in the inputs as the `allowedCharacters` prop is defaulted to `alphanumeric` but you can also choose between allowing only letters or only numbers by setting the prop to `alpha` or `numeric` respectively.
49
+
By default you can type numbers and letters in the inputs as the `allowedCharacters` prop is defaulted to `alphanumeric` but you can also choose between allowing only letters or only numbers by setting the prop to `alpha` or `numeric` respectively.
48
50
49
51
```tsx
50
52
importReact, { useState } from'react';
@@ -122,20 +124,26 @@ This component supports autofill from SMS's received, tested on Safari and Chrom
|`allowedCharacters`| String | Type of allowed characters for your code. |`alphanumeric`| Valid values: `alpha`, `alphanumeric`, `numeric`|
124
126
|`ariaLabel`| String | Accessibility. |||
125
-
|`autoFocus`| Boolean | Wether the first input is focused on mount or not.. | true ||
127
+
|`autoFocus`| Boolean | Wether the first input is focused on mount or not.. | true |Since version 3.1.0|
126
128
|`length`| Number | The number of inputs to display. | 6 ||
127
129
|`containerClassName`| String | The styles to be applied to the container. |||
128
130
|`inputClassName`| String | The styles to be applied to each input. |||
129
131
|`onChange`| Function(value: String) | Callback function called every time an input value changes. || Required |
130
132
|`isPassword`| Boolean | Whether to display the inputs as passwords or not. | false ||
133
+
|`disabled`| Boolean | Makes all the inputs disabled if true. | false | Since version 3.1.1 |
131
134
132
135
## Changelog
133
136
134
137
### 3.1.0
135
138
139
+
- Add `disabled` prop to disable all the inputs.
140
+
- Make the backspace delete the previous character if the current is empty. Previously it just moved the focus making the user hit twice the backspace to delete the value.
141
+
142
+
### 3.1.0
143
+
136
144
- Add `autoFocus` prop set to true by default to not break current usages.
137
-
- Expose a `focus` method to handle the focus of the first input manually.
138
-
- Expose a `clear` method to clear the input programmatically.
145
+
- Expose a `focus` method using references to handle the focus of the first input manually.
146
+
- Expose a `clear` method using references to clear the input programmatically.
139
147
- Add validations for when not using typescript.
140
148
- Update React peerDependency to use any version 16+.
141
149
@@ -146,36 +154,6 @@ This component supports autofill from SMS's received, tested on Safari and Chrom
146
154
- Improved tests.
147
155
- Improved types.
148
156
149
-
### 2.1.0
150
-
151
-
- Support to fill one-time-codes directly from SMS's.
152
-
- Displays numeric keyboard on mobile devices when the `inputType` prop is set to `number`
153
-
- Add `ariaLabel` prop for accessibility.
154
-
155
-
### 2.0.0
156
-
157
-
- Remove `inputStyle` prop in favor of `inputClassName`.
158
-
- Remove `containerStyle` prop in favor of `containerClassName`.
159
-
- Remove `password` prop in favor of `inputType` which accepts _text_, _password_ or _number_ value.
160
-
161
-
### 1.2.1
162
-
163
-
- Add missing dist files.
164
-
165
-
### 1.2.0
166
-
167
-
- Add `inputClassName` and `containerClassName` props.
168
-
- Deprecate `inputStyle` and `containerStyle`.
169
-
- Make `onChange` prop mandatory.
170
-
171
-
### 1.1.0
172
-
173
-
- Typescript support.
174
-
175
-
### 1.0.0
176
-
177
-
- Initial Version. | | deprecated since version 1.2.0 |
0 commit comments