mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
Key入力追加
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user