File tree Expand file tree Collapse file tree 4 files changed +22
-5
lines changed
docs/documentation/docs/about
src/controls/fields/fieldTaxonomyRenderer Expand file tree Collapse file tree 4 files changed +22
-5
lines changed Original file line number Diff line number Diff line change 1
1
# Releases
2
2
3
+ ## 1.2.1
4
+
5
+ ** Fixes**
6
+
7
+ - ` FieldTaxonomyRenderer ` got fixed to support single and multiple values
8
+
3
9
## 1.2.0
4
10
5
11
** New controls**
Original file line number Diff line number Diff line change 1
1
# Releases
2
2
3
+ ## 1.2.1
4
+
5
+ ** Fixes**
6
+
7
+ - ` FieldTaxonomyRenderer ` got fixed to support single and multiple values
8
+
3
9
## 1.2.0
4
10
5
11
** New controls**
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @pnp/spfx-controls-react" ,
3
3
"description" : " Reusable React controls for SharePoint Framework solutions" ,
4
- "version" : " 1.2.0 " ,
4
+ "version" : " 1.2.1 " ,
5
5
"engines" : {
6
6
"node" : " >=0.10.0"
7
7
},
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export interface IFieldTaxonomyRendererProps extends IFieldRendererProps {
11
11
/**
12
12
* terms to display
13
13
*/
14
- terms : ITerm [ ] ;
14
+ terms : ITerm | ITerm [ ] ;
15
15
}
16
16
17
17
/**
@@ -35,9 +35,14 @@ export class FieldTaxonomyRenderer extends React.Component<IFieldTaxonomyRendere
35
35
36
36
@override
37
37
public render ( ) : JSX . Element {
38
- const termEls : JSX . Element [ ] = this . props . terms . map ( ( term ) => {
39
- return < div className = { styles . term } style = { this . props . cssProps } > < span > { term . Label } </ span > </ div > ;
40
- } ) ;
38
+ let termEls : JSX . Element | JSX . Element [ ] = null ;
39
+ if ( Array . isArray ( this . props . terms ) ) {
40
+ termEls = this . props . terms . map ( ( term ) => {
41
+ return < div className = { styles . term } style = { this . props . cssProps } > < span > { term . Label } </ span > </ div > ;
42
+ } ) ;
43
+ } else {
44
+ termEls = < div className = { styles . term } style = { this . props . cssProps } > < span > { this . props . terms . Label } </ span > </ div > ;
45
+ }
41
46
return ( < div style = { this . props . cssProps } className = { css ( this . props . className ) } > { termEls } </ div > ) ;
42
47
}
43
48
}
You can’t perform that action at this time.
0 commit comments