diff --git a/src/js/core/RowManager.js b/src/js/core/RowManager.js index 12357e21d..ca38e4d29 100644 --- a/src/js/core/RowManager.js +++ b/src/js/core/RowManager.js @@ -61,7 +61,7 @@ export default class RowManager extends CoreFeature{ el.classList.add("tabulator-table"); el.setAttribute("role", "rowgroup"); - el.setAttribute("id", "tabulator-table-body"); + el.setAttribute("id", "tabulator-table-body-" + this.table.instanceId); return el; } diff --git a/src/js/core/Tabulator.js b/src/js/core/Tabulator.js index ad0c2572d..45869d7cc 100644 --- a/src/js/core/Tabulator.js +++ b/src/js/core/Tabulator.js @@ -75,6 +75,12 @@ class Tabulator extends ModuleBinder{ if(this.initializeElement(element)){ + if (this.element.id) { + this.instanceId = this.element.id; + } else { + this.instanceId = Math.random().toString(36).slice(2, 7); + } + this.initializeCoreSystems(options); //delay table creation to allow event bindings immediately after the constructor @@ -232,7 +238,7 @@ class Tabulator extends ModuleBinder{ element.classList.add("tabulator"); element.setAttribute("role", "grid"); - element.setAttribute("aria-owns", "tabulator-table-body"); + element.setAttribute("aria-owns", "tabulator-table-body-" + this.instanceId); //empty element while(element.firstChild) element.removeChild(element.firstChild);