1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

Key入力追加

This commit is contained in:
Rokt33r
2015-10-31 18:21:42 +09:00
parent 3d0b79f674
commit 954e148be3
10 changed files with 164 additions and 31 deletions

View File

@@ -17,7 +17,12 @@ export default class TagSelect extends React.Component {
e.preventDefault()
let tags = this.props.tags.slice(0)
let newTag = this.state.input
let newTag = this.state.input.trim()
if (newTag.length === 0) {
this.setState({input: ''})
return
}
tags.push(newTag)
tags = _.uniq(tags)