Skip to content

Commit

Permalink
fixes #1328 - setReadonly method should only blur if the currenct a…
Browse files Browse the repository at this point in the history
…ctive element is that specific Tagify instance. This might not work if an external button was used to trigger this method.
  • Loading branch information
yairEO committed Apr 28, 2024
1 parent eacaa77 commit 69eb547
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tagify.js
Expand Up @@ -1008,7 +1008,7 @@ Tagify.prototype = {
setReadonly( toggle, attrribute ){
var _s = this.settings

document.activeElement.blur() // exit possible edit-mode
this.DOM.scope.contains(document.activeElement) && document.activeElement.blur() // exit possible edit-mode
_s[attrribute || 'readonly'] = toggle
this.DOM.scope[(toggle ? 'set' : 'remove') + 'Attribute'](attrribute || 'readonly', true)

Expand Down

0 comments on commit 69eb547

Please sign in to comment.