@@ -45,7 +45,6 @@ class ReactTags extends Component {
45
45
allowDeleteFromEmptyInput : PropTypes . bool ,
46
46
allowAdditionFromPaste : PropTypes . bool ,
47
47
allowDragDrop : PropTypes . bool ,
48
- resetInputOnDelete : PropTypes . bool ,
49
48
handleInputChange : PropTypes . func ,
50
49
handleInputFocus : PropTypes . func ,
51
50
handleInputBlur : PropTypes . func ,
@@ -81,7 +80,6 @@ class ReactTags extends Component {
81
80
handleAddition : noop ,
82
81
allowDeleteFromEmptyInput : true ,
83
82
allowAdditionFromPaste : true ,
84
- resetInputOnDelete : true ,
85
83
autocomplete : false ,
86
84
readOnly : false ,
87
85
allowUnique : true ,
@@ -114,7 +112,6 @@ class ReactTags extends Component {
114
112
this . handleChange = this . handleChange . bind ( this ) ;
115
113
this . moveTag = this . moveTag . bind ( this ) ;
116
114
this . handlePaste = this . handlePaste . bind ( this ) ;
117
- this . resetAndFocusInput = this . resetAndFocusInput . bind ( this ) ;
118
115
this . handleSuggestionHover = this . handleSuggestionHover . bind ( this ) ;
119
116
this . handleSuggestionClick = this . handleSuggestionClick . bind ( this ) ;
120
117
}
@@ -153,33 +150,23 @@ class ReactTags extends Component {
153
150
. indexOf ( query . toLowerCase ( ) ) ;
154
151
} ;
155
152
156
- resetAndFocusInput ( ) {
153
+ resetAndFocusInput = ( ) => {
157
154
this . setState ( { query : '' } ) ;
158
155
if ( this . textInput ) {
159
156
this . textInput . value = '' ;
160
157
this . textInput . focus ( ) ;
161
158
}
162
159
}
163
160
164
- handleDelete ( i , e ) {
165
- this . props . handleDelete ( i , e ) ;
166
- if ( ! this . props . resetInputOnDelete ) {
167
- this . textInput && this . textInput . focus ( ) ;
168
- } else {
169
- this . resetAndFocusInput ( ) ;
170
- }
171
- e . stopPropagation ( ) ;
161
+ handleDelete ( index , event ) {
162
+ this . props . handleDelete ( index , event ) ;
163
+ event . stopPropagation ( ) ;
172
164
}
173
165
174
166
handleTagClick ( i , e ) {
175
167
if ( this . props . handleTagClick ) {
176
168
this . props . handleTagClick ( i , e ) ;
177
169
}
178
- if ( ! this . props . resetInputOnDelete ) {
179
- this . textInput && this . textInput . focus ( ) ;
180
- } else {
181
- this . resetAndFocusInput ( ) ;
182
- }
183
170
}
184
171
185
172
handleChange ( e ) {
0 commit comments