@@ -171,8 +171,6 @@ class ReactTags extends React.Component {
171
171
}
172
172
173
173
render ( ) {
174
- const listboxId = 'ReactTags-listbox'
175
-
176
174
const TagComponent = this . props . tagComponent || Tag
177
175
178
176
const tags = this . props . tags . map ( ( tag , i ) => (
@@ -190,7 +188,10 @@ class ReactTags extends React.Component {
190
188
191
189
return (
192
190
< div className = { classNames . join ( ' ' ) } onClick = { this . onClick . bind ( this ) } >
193
- < div className = { this . state . classNames . selected } aria-live = 'polite' aria-relevant = 'additions removals' >
191
+ < div
192
+ className = { this . state . classNames . selected }
193
+ aria-relevant = 'additions removals'
194
+ aria-live = 'polite' >
194
195
{ tags }
195
196
</ div >
196
197
< div
@@ -200,14 +201,14 @@ class ReactTags extends React.Component {
200
201
onKeyDown = { this . onKeyDown . bind ( this ) }
201
202
onInput = { this . onInput . bind ( this ) } >
202
203
< Input { ...this . state }
204
+ id = { this . props . id }
203
205
ref = { ( c ) => { this . input = c } }
204
- listboxId = { listboxId }
205
206
autoresize = { this . props . autoresize }
206
207
expanded = { expanded }
207
208
placeholder = { this . props . placeholder } />
208
209
< Suggestions { ...this . state }
210
+ id = { this . props . id }
209
211
ref = { ( c ) => { this . suggestions = c } }
210
- listboxId = { listboxId }
211
212
expanded = { expanded }
212
213
addTag = { this . addTag . bind ( this ) } />
213
214
</ div >
@@ -217,6 +218,7 @@ class ReactTags extends React.Component {
217
218
}
218
219
219
220
ReactTags . defaultProps = {
221
+ id : 'ReactTags' ,
220
222
tags : [ ] ,
221
223
placeholder : 'Add new tag' ,
222
224
suggestions : [ ] ,
@@ -230,6 +232,7 @@ ReactTags.defaultProps = {
230
232
}
231
233
232
234
ReactTags . propTypes = {
235
+ id : PropTypes . string ,
233
236
tags : PropTypes . arrayOf ( PropTypes . object ) ,
234
237
placeholder : PropTypes . string ,
235
238
suggestions : PropTypes . arrayOf ( PropTypes . object ) ,
0 commit comments