File tree Expand file tree Collapse file tree 5 files changed +23
-3
lines changed
app/(gcforms)/[locale]/(form administration)/form-builder/components/shared/email-tags Expand file tree Collapse file tree 5 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ export const EmailTags = ({
33
33
} }
34
34
label = { t ( "share.emailLabel" , { ns : "form-builder" } ) }
35
35
description = ""
36
+ allowSpacesInTags = { false }
36
37
onTagAdd = { ( tag ) => {
37
38
setTags ( [ ...new Set ( [ ...tags , tag ] ) ] ) ;
38
39
} }
Original file line number Diff line number Diff line change @@ -5,6 +5,16 @@ 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.1] - 2025-06-12
9
+
10
+ ### Added
11
+
12
+ - Add allowSpacesInTags prop. When false, enable space to close tags.
13
+
14
+ ### Fixed
15
+
16
+ - Improved styling on tag input element
17
+
8
18
## [ 1.0.0] - 2025-05-14
9
19
10
20
### Added
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @gcforms/tag-input" ,
3
- "version" : " 1.0.0 " ,
3
+ "version" : " 1.0.1 " ,
4
4
"author" : " Canadian Digital Service" ,
5
5
"license" : " MIT" ,
6
6
"publishConfig" : {
Original file line number Diff line number Diff line change @@ -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 = [ keys . ENTER , keys . TAB , keys . COMMA ] ;
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
Original file line number Diff line number Diff line change 55
55
}
56
56
57
57
input {
58
- display : inline-block;
58
+ display : flex;
59
+ flex : 1 1 0% ;
60
+ min-width : 120px ;
59
61
padding-top : 0.25rem ;
60
62
padding-bottom : 0.25rem ;
61
63
padding-left : 0.5rem ;
You can’t perform that action at this time.
0 commit comments