Skip to content

Commit

Permalink
SAK-50661 Gradebook Tabulator Fix z-Index stacking issue on dropdown …
Browse files Browse the repository at this point in the history
…menu
  • Loading branch information
kunaljaykam committed Nov 5, 2024
1 parent 08c8363 commit 02967ca
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions gradebookng/tool/src/webapp/scripts/gradebook-gbgrade-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -1049,6 +1049,21 @@ GbGradeTable.renderTable = function (elementId, tableData) {
dropdownMenu.classList.add("gb-dropdown-menu");

dropdownMenu.dataset.cell = link.closest(".tabulator-cell, .tabulator-col");

// Temporarily attach dropdown to body to avoid stacking issues in frozen(fixed) columns
document.body.appendChild(dropdownMenu);
dropdownMenu.style.position = 'absolute';

const rect = link.getBoundingClientRect();
dropdownMenu.style.top = `${rect.bottom + window.scrollY}px`;
dropdownMenu.style.left = `${rect.left + window.scrollX}px`;

link.addEventListener('hidden.bs.dropdown', function () {
link.parentNode.appendChild(dropdownMenu);
dropdownMenu.style.position = '';
dropdownMenu.style.top = '';
dropdownMenu.style.left = '';
}, { once: true });
});

document.querySelector(".tabulator-tableholder")?.addEventListener("scroll", function (event) {
Expand Down

0 comments on commit 02967ca

Please sign in to comment.