File tree 1 file changed +5
-4
lines changed
packages/react-components/source/react/library/tag
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
- import { node , func } from 'prop-types' ;
2
+ import { func , string } from 'prop-types' ;
3
3
import Button from '../button' ;
4
4
import Text from '../text' ;
5
5
6
6
const propTypes = {
7
7
/** Tag text or other content */
8
- children : node . isRequired ,
8
+ label : string . isRequired ,
9
9
/** Callback function called when clode icon is clicked */
10
10
onClick : func ,
11
11
} ;
@@ -14,16 +14,17 @@ const defaultProps = {
14
14
onClick : ( ) => { } ,
15
15
} ;
16
16
17
- const Tag = ( { children , onClick } ) => {
17
+ const Tag = ( { label , onClick } ) => {
18
18
return (
19
19
< div className = "rc-tag" >
20
20
< div className = "rc-tag-label-background" >
21
- < Text className = "rc-tag-text" > { children } </ Text >
21
+ < Text className = "rc-tag-text" > { label } </ Text >
22
22
</ div >
23
23
< Button
24
24
className = "rc-tag-remove-button"
25
25
onClick = { ( ) => onClick ( ) }
26
26
icon = "close"
27
+ aria-label = { `${ label } Remove tag` }
27
28
/>
28
29
</ div >
29
30
) ;
You can’t perform that action at this time.
0 commit comments