From e0f8003f59cad9d3d74b72fc56cf0a8002a59f9a Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Thu, 10 May 2018 21:23:30 +0200 Subject: [PATCH] Do not add terms when tabbing away from the field. (#6622) Props @afercia --- components/form-token-field/index.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/components/form-token-field/index.js b/components/form-token-field/index.js index 7d33e286f9bec..a81b4bb632a7c 100644 --- a/components/form-token-field/index.js +++ b/components/form-token-field/index.js @@ -94,7 +94,7 @@ class FormTokenField extends Component { onBlur() { if ( this.inputHasValidValue() ) { - this.setState( { isActive: false }, this.addCurrentToken ); + this.setState( { isActive: false } ); } else { this.setState( initialState ); } @@ -107,9 +107,6 @@ class FormTokenField extends Component { case 8: // backspace (delete to left) preventDefault = this.handleDeleteKey( this.deleteTokenBeforeInput ); break; - case 9: // tab - preventDefault = this.addCurrentToken(); - break; case 13: // enter/return preventDefault = this.addCurrentToken(); break;