diff --git a/src/parts/events.js b/src/parts/events.js index 6e1432b1..c7d623fd 100644 --- a/src/parts/events.js +++ b/src/parts/events.js @@ -279,9 +279,10 @@ export default { isBelong = withinTag && this.DOM.scope.contains(focusedElm), isInputNode = focusedElm === this.DOM.input, isReadyOnlyTag = isBelong && focusedElm.hasAttribute('readonly'), + tagText = this.DOM.scope.querySelector('.' + this.settings.classNames.tagText), nextTag; - if( !this.state.hasFocus && (!isBelong || isReadyOnlyTag) || isInputNode ) return; + if( !(e.key === 'Tab' && this.state.dropdown.visible) && !this.state.hasFocus && (!isBelong || isReadyOnlyTag) || isInputNode ) return; nextTag = focusedElm.nextElementSibling; @@ -316,6 +317,11 @@ export default { this.dropdown.show() break; } + + case 'Tab': { + tagText?.focus(); + break; + } } },