|
|
@ -142,9 +142,7 @@
|
|
|
|
for (let i = 0; i < this.state.tags.length; i++) {
|
|
|
|
for (let i = 0; i < this.state.tags.length; i++) {
|
|
|
|
if (value === this.state.tags[i]) {
|
|
|
|
if (value === this.state.tags[i]) {
|
|
|
|
inArray = true
|
|
|
|
inArray = true
|
|
|
|
|
|
|
|
|
|
|
|
this.state.errors.push('Already added')
|
|
|
|
this.state.errors.push('Already added')
|
|
|
|
this.update()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -153,14 +151,13 @@
|
|
|
|
// if value is not already in data and longer than zero chars
|
|
|
|
// if value is not already in data and longer than zero chars
|
|
|
|
if (inArray === false && value.length > 0) {
|
|
|
|
if (inArray === false && value.length > 0) {
|
|
|
|
this.state.tags.push(value)
|
|
|
|
this.state.tags.push(value)
|
|
|
|
this.update()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.$('input').value = ''
|
|
|
|
this.$('input').value = ''
|
|
|
|
} else if (value.length === 0) {
|
|
|
|
} else if (value.length === 0) {
|
|
|
|
this.state.errors.push('Required!')
|
|
|
|
this.state.errors.push('Required!')
|
|
|
|
this.update()
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.update()
|
|
|
|
|
|
|
|
|
|
|
|
// adding focus to input
|
|
|
|
// adding focus to input
|
|
|
|
this.$('input').focus();
|
|
|
|
this.$('input').focus();
|
|
|
|
}
|
|
|
|
}
|
|
|
|