mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
modify: remove add tag button
This commit is contained in:
@@ -9,7 +9,6 @@ class TagSelect extends React.Component {
|
||||
|
||||
this.state = {
|
||||
newTag: '',
|
||||
inputReady: false,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +76,6 @@ class TagSelect extends React.Component {
|
||||
newTag: ''
|
||||
}, () => {
|
||||
this.value = value
|
||||
this.setState({ inputReady: false })
|
||||
this.props.onChange()
|
||||
})
|
||||
}
|
||||
@@ -100,12 +98,6 @@ class TagSelect extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
handleNewTagInputReady (e) {
|
||||
this.setState({
|
||||
inputReady: true,
|
||||
})
|
||||
}
|
||||
|
||||
render () {
|
||||
let { value, className } = this.props
|
||||
|
||||
@@ -134,27 +126,13 @@ class TagSelect extends React.Component {
|
||||
styleName='root'
|
||||
>
|
||||
{tagList}
|
||||
{(() => {
|
||||
if (this.state.inputReady) {
|
||||
return (
|
||||
<input styleName='newTag'
|
||||
ref='newTag'
|
||||
value={this.state.newTag}
|
||||
placeholder='Add tag...'
|
||||
onChange={(e) => this.handleNewTagInputChange(e)}
|
||||
onKeyDown={(e) => this.handleNewTagInputKeyDown(e)}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<button styleName='add-tag-button'
|
||||
onClick={(e) => this.handleNewTagInputReady(e)}
|
||||
>
|
||||
<i className='fa fa-plus' />
|
||||
</button>
|
||||
)
|
||||
})()}
|
||||
<input styleName='newTag'
|
||||
ref='newTag'
|
||||
value={this.state.newTag}
|
||||
placeholder='Add tag...'
|
||||
onChange={(e) => this.handleNewTagInputChange(e)}
|
||||
onKeyDown={(e) => this.handleNewTagInputKeyDown(e)}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user