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

submit the tag when receiving 'tab' key

In existing implementation, 'enter' key is only allowed to submit the tag. However, if the user finishes to create the tag and make another tag, the user naturally send 'tab' key.
When receiving 'tab' key, the focus will go to the star icon and nothing is submitted, but the text is still remained. This makes confusing to the user.

This commit provide 'tab' key submitting the tag also.
This commit is contained in:
yosmoc
2016-08-24 22:34:34 +02:00
parent 5e1dd4a9ad
commit 0490b115ad

View File

@@ -22,6 +22,10 @@ class TagSelect extends React.Component {
handleNewTagInputKeyDown (e) {
switch (e.keyCode) {
case 9:
e.preventDefault()
this.submitTag()
break
case 13:
this.submitTag()
break