File tree 3 files changed +8
-4
lines changed
3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 17
17
:autocomplete-items =" autocompleteItems"
18
18
@tags-changed =" tagsChanged"
19
19
/>
20
+ <input type =" text" />
20
21
{{ tags }}
21
22
</div>
22
23
</template >
Original file line number Diff line number Diff line change @@ -356,10 +356,12 @@ export default {
356
356
this . $emit ( 'update:tags' , this . tagsCopy ) ;
357
357
}
358
358
} ,
359
- blurred ( e ) {
359
+ blurredOnClick ( e ) {
360
360
// if the click occurs on tagsinput → don't hide
361
361
if ( this . $el . contains ( e . target ) || this . $el . contains ( document . activeElement ) ) return ;
362
-
362
+ this . performBlur ( e ) ;
363
+ } ,
364
+ performBlur ( ) {
363
365
// If we should add tags before blurring → add tag
364
366
if ( this . addOnBlur && this . focused ) this . performAddTags ( this . newTag ) ;
365
367
@@ -391,9 +393,9 @@ export default {
391
393
this . selectDefaultItem ( ) ;
392
394
393
395
// We add a event listener to hide autocomplete on blur
394
- document . addEventListener ( 'click' , this . blurred ) ;
396
+ document . addEventListener ( 'click' , this . blurredOnClick ) ;
395
397
} ,
396
398
destroyed ( ) {
397
- document . removeEventListener ( 'click' , this . blurred ) ;
399
+ document . removeEventListener ( 'click' , this . blurredOnClick ) ;
398
400
} ,
399
401
} ;
Original file line number Diff line number Diff line change 135
135
)"
136
136
@paste="addTagsFromPaste"
137
137
@keydown.8="invokeDelete"
138
+ @keydown.9="performBlur"
138
139
@keydown.38="selectItem($event, 'before')"
139
140
@keydown.40="selectItem($event, 'after')"
140
141
@input="updateNewTag"
You can’t perform that action at this time.
0 commit comments