File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
packages/site/src/routes/demo/chip-input Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 39
39
40
40
// And we can push our own object containing the text.
41
41
colors .push ({
42
- id: Math .max (... colors .map ((color ) => color .id )) + 1 ,
42
+ id: colors . length ? Math .max (... colors .map ((color ) => color .id )) + 1 : 1 ,
43
43
text: event .detail .text ,
44
44
});
45
45
value = ' ' ;
51
51
52
52
// And we can push our own object containing the text.
53
53
colors .push ({
54
- id: Math .max (... colors .map ((color ) => color .id )) + 1 ,
54
+ id: colors . length ? Math .max (... colors .map ((color ) => color .id )) + 1 : 1 ,
55
55
text: event .detail ,
56
56
});
57
57
value = ' ' ;
Original file line number Diff line number Diff line change 37
37
38
38
// And we can push our own object containing the text.
39
39
items .push ({
40
- id: Math .max (... items .map ((tag ) => tag .id )) + 1 ,
40
+ id: items . length ? Math .max (... items .map ((tag ) => tag .id )) + 1 : 1 ,
41
41
text: event .detail .text ,
42
42
});
43
43
value = ' ' ;
You can’t perform that action at this time.
0 commit comments