Skip to content

Commit

Permalink
Input elements in Safari lose focus when the list attribute is added.…
Browse files Browse the repository at this point in the history
… As a workaround, we set a non-existing dataset id to disable auto-completion instead of removing the attribute. The list attribute is then set from Tagger initialisation.
  • Loading branch information
lucasnetau committed Jul 1, 2022
1 parent 027f193 commit b2f7f93
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tagger.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
wrapper.appendChild(this._ul);
li.appendChild(this._completion);
this._add_events();
this._toggle_completion(false);
if (this._settings.completion.list instanceof Array) {
this._build_completion(this._settings.completion.list);
}
Expand Down Expand Up @@ -233,7 +234,7 @@
if (toggle) {
this._new_input_tag.setAttribute('list', 'tagger-completion-' + this._id);
} else {
this._new_input_tag.removeAttribute('list');
this._new_input_tag.setAttribute('list', 'tagger-completion-disabled-' + this._id);
}
},
// --------------------------------------------------------------------------------------
Expand Down

0 comments on commit b2f7f93

Please sign in to comment.