From b7f4af8c7844aba4daafd362275ba069cc5aa804 Mon Sep 17 00:00:00 2001 From: yosmoc Date: Thu, 30 Nov 2017 22:04:56 +0100 Subject: [PATCH] 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. --- browser/main/Detail/TagSelect.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/browser/main/Detail/TagSelect.js b/browser/main/Detail/TagSelect.js index 49616d16..3e1efb86 100644 --- a/browser/main/Detail/TagSelect.js +++ b/browser/main/Detail/TagSelect.js @@ -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)} /> )