Skip to content

Commit

Permalink
Fix Table THead Query Selector to target only first THead for FixedHe…
Browse files Browse the repository at this point in the history
…ader and Resize features. (#3155)
  • Loading branch information
David-Moreira authored Nov 24, 2021
1 parent e1b9242 commit 5fb6697
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Source/Blazorise/wwwroot/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
}

function resizeHandler(element) {
const tableRows = element.querySelectorAll("thead tr");
const thead = element.querySelector("thead:first-child");
const tableRows = thead.querySelectorAll("tr");
if (tableRows !== null && tableRows.length > 1) {
let previousRowCellHeight = 0;
for (let i = 0; i < tableRows.length; i++) {
Expand All @@ -31,7 +32,8 @@ export function destroyTableFixedHeader(element, elementId) {
if (typeof this.resizeThottler === "function") {
window.removeEventListener("resize", this.resizeThottler);
}
const tableRows = element.querySelectorAll("thead tr");
const thead = element.querySelector("thead:first-child");
const tableRows = thead.querySelectorAll("tr");

if (tableRows !== null && tableRows.length > 1) {
for (let i = 0; i < tableRows.length; i++) {
Expand Down Expand Up @@ -68,7 +70,8 @@ export function initializeResizable(element, elementId, mode) {
let cols = null;

if (element !== null) {
cols = element.querySelectorAll('thead tr:first-child > th');
const thead = element.querySelector("thead:first-child");
cols = thead.querySelectorAll('tr:first-child > th');
}

if (cols !== null) {
Expand Down

0 comments on commit 5fb6697

Please sign in to comment.