Skip to content

Commit

Permalink
fixes #1113 - support disallowing user input in select-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Yair Even Or authored and Yair Even Or committed Sep 3, 2022
1 parent 7431b0a commit 3d50e58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/parts/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ export default {
onKeydown(e){
var _s = this.settings;

// ignore keys during IME composition
if( this.state.composing )
// ignore keys during IME composition or when user input is not allowed
if( this.state.composing || !_s.userInput )
return

if( _s.mode == 'select' && _s.enforceWhitelist && this.value.length && e.key != 'Tab' ){
Expand Down
1 change: 1 addition & 0 deletions src/tagify.js
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,7 @@ Tagify.prototype = {
},

setContentEditable(state){
if( !this.settings.userInput ) return;
this.DOM.input.contentEditable = state
this.DOM.input.tabIndex = !!state ? 0 : -1;
},
Expand Down

0 comments on commit 3d50e58

Please sign in to comment.