Skip to content
This repository was archived by the owner on Nov 3, 2024. It is now read-only.

Commit 472f691

Browse files
authored
Merge pull request #42 from drac94/v3.1.1
V3.1.1
2 parents b11a986 + 01638f5 commit 472f691

10 files changed

+188
-171
lines changed

README.md

+13-35
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![image](https://user-images.githubusercontent.com/1719915/159336862-113dfbdd-e415-4237-afdb-f9df6628aaf7.png)
1+
![image](https://user-images.githubusercontent.com/1719915/159784302-4bb83708-e993-4800-9bcf-091ecb709ef7.png)
22

33
# React Auth Code Input
44

@@ -26,6 +26,8 @@ or
2626
yarn add react-auth-code-input
2727
```
2828

29+
# Version 3+
30+
2931
## Basic Usage
3032

3133
```tsx
@@ -44,7 +46,7 @@ const App = () => {
4446

4547
## Mode
4648

47-
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.
4850

4951
```tsx
5052
import React, { useState } from 'react';
@@ -122,20 +124,26 @@ This component supports autofill from SMS's received, tested on Safari and Chrom
122124
| :------------------- | :---------------------- | :---------------------------------------------------------- | :------------- | :----------------------------------------------- |
123125
| `allowedCharacters` | String | Type of allowed characters for your code. | `alphanumeric` | Valid values: `alpha`, `alphanumeric`, `numeric` |
124126
| `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 |
126128
| `length` | Number | The number of inputs to display. | 6 | |
127129
| `containerClassName` | String | The styles to be applied to the container. | | |
128130
| `inputClassName` | String | The styles to be applied to each input. | | |
129131
| `onChange` | Function(value: String) | Callback function called every time an input value changes. | | Required |
130132
| `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 |
131134

132135
## Changelog
133136

134137
### 3.1.0
135138

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+
136144
- 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.
139147
- Add validations for when not using typescript.
140148
- Update React peerDependency to use any version 16+.
141149

@@ -146,36 +154,6 @@ This component supports autofill from SMS's received, tested on Safari and Chrom
146154
- Improved tests.
147155
- Improved types.
148156

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 |
178-
179157
## License
180158

181159
Licensed under the MIT License, Copyright © 2020-present Luis Guerrero [drac94](https://github.com/drac94).

dist/index.js

+7-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.modern.js

+65-70
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)