@gcforms/tag-input 1.0.0 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/package.json +2 -2
- package/src/TagInput.tsx +8 -1
- package/src/styles.css +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,26 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.0.3] - 2025-09-09
|
|
9
|
+
|
|
10
|
+
- Bump yarn
|
|
11
|
+
|
|
12
|
+
## [1.0.2] - 2025-06-23
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- Update Yarn to version 4.9.2
|
|
17
|
+
|
|
18
|
+
## [1.0.1] - 2025-06-12
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- Add allowSpacesInTags prop. When false, enable space to close tags.
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- Improved styling on tag input element
|
|
27
|
+
|
|
8
28
|
## [1.0.0] - 2025-05-14
|
|
9
29
|
|
|
10
30
|
### Added
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gcforms/tag-input",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"author": "Canadian Digital Service",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
9
|
-
"packageManager": "yarn@4.
|
|
9
|
+
"packageManager": "yarn@4.9.4",
|
|
10
10
|
"peerDependencies": {
|
|
11
11
|
"react": "^19.1.0",
|
|
12
12
|
"react-dom": "^19.1.0"
|
package/src/TagInput.tsx
CHANGED
|
@@ -26,6 +26,7 @@ export const TagInput = ({
|
|
|
26
26
|
placeholder,
|
|
27
27
|
description,
|
|
28
28
|
restrictDuplicates = true,
|
|
29
|
+
allowSpacesInTags = true,
|
|
29
30
|
maxTags,
|
|
30
31
|
onTagAdd,
|
|
31
32
|
onTagRemove,
|
|
@@ -39,6 +40,7 @@ export const TagInput = ({
|
|
|
39
40
|
placeholder?: string;
|
|
40
41
|
description?: string;
|
|
41
42
|
restrictDuplicates?: boolean;
|
|
43
|
+
allowSpacesInTags?: boolean;
|
|
42
44
|
maxTags?: number;
|
|
43
45
|
onTagAdd?: (tag: string) => void;
|
|
44
46
|
onTagRemove?: (tag: string) => void;
|
|
@@ -136,7 +138,12 @@ export const TagInput = ({
|
|
|
136
138
|
resetMessages();
|
|
137
139
|
|
|
138
140
|
const { key } = event;
|
|
139
|
-
const acceptKeys = [
|
|
141
|
+
const acceptKeys = [
|
|
142
|
+
keys.ENTER,
|
|
143
|
+
keys.TAB,
|
|
144
|
+
keys.COMMA,
|
|
145
|
+
...(allowSpacesInTags ? [] : [keys.SPACE]),
|
|
146
|
+
];
|
|
140
147
|
const navigateKeys = [keys.ARROW_LEFT, keys.ARROW_RIGHT];
|
|
141
148
|
|
|
142
149
|
// Clear selection when entering text input
|