File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/components/chipsInput Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,10 @@ class ChipsInput extends Component {
42
42
* callback for custom rendering tag item
43
43
*/
44
44
renderTag : PropTypes . elementType ,
45
+ /**
46
+ * callback for custom rendering invalid tag item
47
+ */
48
+ renderInvalidTag : PropTypes . elementType ,
45
49
/**
46
50
* callback for onChangeTags event
47
51
*/
@@ -261,11 +265,15 @@ class ChipsInput extends Component {
261
265
}
262
266
263
267
renderTag = ( tag , index ) => {
264
- const { tagStyle, renderTag} = this . props ;
268
+ const { tagStyle, renderTag, renderInvalidTag } = this . props ;
265
269
const { tagIndexToRemove} = this . state ;
266
270
const shouldMarkTag = tagIndexToRemove === index ;
267
271
268
272
if ( tag . invalid ) {
273
+ if ( _ . isFunction ( renderInvalidTag ) ) {
274
+ return renderInvalidTag ( tag , index , shouldMarkTag , this . getLabel ( tag ) ) ;
275
+ }
276
+
269
277
return (
270
278
< View
271
279
key = { index }
You can’t perform that action at this time.
0 commit comments