Skip to content
Snippets Groups Projects
Commit 1884e522 authored by Bekerle, Patrizio's avatar Bekerle, Patrizio :fire: Committed by Reiter, Christoph
Browse files

Fix instantiating Select2 multiple times in different custom elements

parent fe399cdc
No related branches found
No related tags found
No related merge requests found
......@@ -11,8 +11,6 @@ import commonUtils from 'vpu-common/utils';
select2(window, $);
let selectId = 0;
class PersonSelect extends VPULitElementJQuery {
constructor() {
......@@ -21,8 +19,8 @@ class PersonSelect extends VPULitElementJQuery {
this.entryPointUrl = getAPiUrl();
this.jsonld = null;
this.$select = null;
// For some reason using the same ID twice breaks select2
this.selectId = 'person-select' + selectId++;
// For some reason using the same ID on the whole page twice breaks select2 (regardless if they are in different custom elements)
this.selectId = 'person-select-' + commonUtils.makeId(24);
}
static get properties() {
......
common @ 33228856
Subproject commit 378256b0ae92712fd5b8feed3a987cd014617c0b
Subproject commit 332288561f010110799081f426d4addfc0b1ffcd
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment