File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 1717 :autocomplete-items =" autocompleteItems"
1818 @tags-changed =" tagsChanged"
1919 />
20+ <input type =" text" />
2021 {{ tags }}
2122 </div>
2223</template >
Original file line number Diff line number Diff line change @@ -356,10 +356,12 @@ export default {
356356 this . $emit ( 'update:tags' , this . tagsCopy ) ;
357357 }
358358 } ,
359- blurred ( e ) {
359+ blurredOnClick ( e ) {
360360 // if the click occurs on tagsinput → don't hide
361361 if ( this . $el . contains ( e . target ) || this . $el . contains ( document . activeElement ) ) return ;
362-
362+ this . performBlur ( e ) ;
363+ } ,
364+ performBlur ( ) {
363365 // If we should add tags before blurring → add tag
364366 if ( this . addOnBlur && this . focused ) this . performAddTags ( this . newTag ) ;
365367
@@ -391,9 +393,9 @@ export default {
391393 this . selectDefaultItem ( ) ;
392394
393395 // We add a event listener to hide autocomplete on blur
394- document . addEventListener ( 'click' , this . blurred ) ;
396+ document . addEventListener ( 'click' , this . blurredOnClick ) ;
395397 } ,
396398 destroyed ( ) {
397- document . removeEventListener ( 'click' , this . blurred ) ;
399+ document . removeEventListener ( 'click' , this . blurredOnClick ) ;
398400 } ,
399401} ;
Original file line number Diff line number Diff line change 135135 )"
136136 @paste =" addTagsFromPaste"
137137 @keydown.8 =" invokeDelete"
138+ @keydown.9 =" performBlur"
138139 @keydown.38 =" selectItem($event, 'before')"
139140 @keydown.40 =" selectItem($event, 'after')"
140141 @input =" updateNewTag"
You can’t perform that action at this time.
0 commit comments