@@ -18,15 +18,7 @@ import { RX_SPACES } from '../../constants/regex'
1818import { SLOT_NAME_DEFAULT , SLOT_NAME_ADD_BUTTON_TEXT } from '../../constants/slots'
1919import { arrayIncludes , concat } from '../../utils/array'
2020import { cssEscape } from '../../utils/css-escape'
21- import {
22- attemptBlur ,
23- attemptFocus ,
24- closest ,
25- isActiveElement ,
26- matches ,
27- requestAF ,
28- select
29- } from '../../utils/dom'
21+ import { attemptBlur , attemptFocus , closest , matches , requestAF , select } from '../../utils/dom'
3022import { eventOn , eventOff , stopEvent } from '../../utils/events'
3123import { identity } from '../../utils/identity'
3224import { isEvent , isNumber , isString } from '../../utils/inspect'
@@ -39,6 +31,7 @@ import { formControlMixin, props as formControlProps } from '../../mixins/form-c
3931import { formSizeMixin , props as formSizeProps } from '../../mixins/form-size'
4032import { formStateMixin , props as formStateProps } from '../../mixins/form-state'
4133import { idMixin , props as idProps } from '../../mixins/id'
34+ import { listenersMixin } from '../../mixins/listeners'
4235import { normalizeSlotMixin } from '../../mixins/normalize-slot'
4336import { BButton } from '../button/button'
4437import { BFormInvalidFeedback } from '../form/form-invalid-feedback'
@@ -144,6 +137,7 @@ const props = makePropsConfigurable(
144137export const BFormTags = /*#__PURE__*/ Vue . extend ( {
145138 name : NAME_FORM_TAGS ,
146139 mixins : [
140+ listenersMixin ,
147141 idMixin ,
148142 modelMixin ,
149143 formControlMixin ,
@@ -186,6 +180,7 @@ export const BFormTags = /*#__PURE__*/ Vue.extend({
186180 } ,
187181 computedInputHandlers ( ) {
188182 return {
183+ ...this . bvListeners ,
189184 input : this . onInputInput ,
190185 change : this . onInputChange ,
191186 keydown : this . onInputKeydown ,
@@ -338,10 +333,6 @@ export const BFormTags = /*#__PURE__*/ Vue.extend({
338333 // will prevent the tag from being removed (i.e. confirmation)
339334 // Or emit cancelable `BvEvent`
340335 this . tags = this . tags . filter ( t => t !== tag )
341- // Return focus to the input (if possible)
342- this . $nextTick ( ( ) => {
343- this . focus ( )
344- } )
345336 } ,
346337 reset ( ) {
347338 this . newTag = ''
@@ -413,13 +404,8 @@ export const BFormTags = /*#__PURE__*/ Vue.extend({
413404 } ,
414405 // --- Wrapper event handlers ---
415406 onClick ( event ) {
416- const ignoreFocusSelector = this . computeIgnoreInputFocusSelector
417- const { target } = event
418- if (
419- ! this . disabled &&
420- ! isActiveElement ( target ) &&
421- ( ! ignoreFocusSelector || ! closest ( ignoreFocusSelector , target , true ) )
422- ) {
407+ const { computeIgnoreInputFocusSelector : ignoreFocusSelector } = this
408+ if ( ! ignoreFocusSelector || ! closest ( ignoreFocusSelector , event . target , true ) ) {
423409 this . $nextTick ( ( ) => {
424410 this . focus ( )
425411 } )
@@ -434,7 +420,7 @@ export const BFormTags = /*#__PURE__*/ Vue.extend({
434420 handleAutofocus ( ) {
435421 this . $nextTick ( ( ) => {
436422 requestAF ( ( ) => {
437- if ( this . autofocus && ! this . disabled ) {
423+ if ( this . autofocus ) {
438424 this . focus ( )
439425 }
440426 } )
0 commit comments