1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 01:36:22 +00:00

confirm tag at onBlur event

When user inputs the tag and leave the tag input box without fixing(enter or tab key), tag string is still there, but it is not stored as a tag.

This changes solved this problem. When the cursol is out of the tag input, it registers the input as a tag.
This commit is contained in:
yosmoc
2017-11-30 22:04:56 +01:00
parent a6c7dde194
commit b7f4af8c78

View File

@@ -38,6 +38,10 @@ class TagSelect extends React.Component {
}
}
handleNewTagBlur (e) {
this.submitTag()
}
removeLastTag () {
let { value } = this.props
@@ -135,6 +139,7 @@ class TagSelect extends React.Component {
placeholder='Add tag...'
onChange={(e) => this.handleNewTagInputChange(e)}
onKeyDown={(e) => this.handleNewTagInputKeyDown(e)}
onBlur={(e) => this.handleNewTagBlur(e)}
/>
</div>
)