Skip to content

Commit 574e64d

Browse files
authored
fixes typo seprators should be separators (#32)
1 parent dfdacb0 commit 574e64d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default Example;
6464
| `classNames` | className for styling input and tags (i.e {tag:'tag-cls', input: 'input-cls'}) | `object[tag, input]` | |
6565
| `onKeyUp` | input `onKeyUp` callback | `event` | |
6666
| `onBlur` | input `onBlur` callback | `event` | |
67-
| `seprators` | when to add tag (i.e. `Space`,`Enter`) | `string[]` | `["Enter"]` |
67+
| `separators` | when to add tag (i.e. `Space`,`Enter`) | `string[]` | `["Enter"]` |
6868
| `removers` | Remove last tag if textbox empty and `Backspace` is pressed | `string[]` | `["Backspace"]` |
6969
| `onExisting` | if tag is already added then callback | `(tag: string) => void` | |
7070
| `onRemoved` | on tag removed callback | `(tag: string) => void` | |

src/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export interface TagsInputProps {
1212
value?: string[];
1313
onChange?: (tags: string[]) => void;
1414
onBlur?: any;
15-
seprators?: string[];
15+
separators?: string[];
1616
disableBackspaceRemove?: boolean;
1717
onExisting?: (tag: string) => void;
1818
onRemoved?: (tag: string) => void;
@@ -26,15 +26,15 @@ export interface TagsInputProps {
2626
};
2727
}
2828

29-
const defaultSeprators = ["Enter"];
29+
const defaultSeparators = ["Enter"];
3030

3131
export const TagsInput = ({
3232
name,
3333
placeHolder,
3434
value,
3535
onChange,
3636
onBlur,
37-
seprators,
37+
separators,
3838
disableBackspaceRemove,
3939
onExisting,
4040
onRemoved,
@@ -71,7 +71,7 @@ export const TagsInput = ({
7171
setTags([...tags.slice(0, -1)]);
7272
}
7373

74-
if (text && (seprators || defaultSeprators).includes(e.key)) {
74+
if (text && (separators || defaultSeparators).includes(e.key)) {
7575
if (beforeAddValidate && !beforeAddValidate(text, tags)) return;
7676

7777
if (tags.includes(text)) {

0 commit comments

Comments
 (0)