I am trying to use bootstrap-table and give it an "Excel feeling". With the option to quickly filter a column based on the values inside. But I can't seem to make it work with sticky headers, there is a bootstrap-table addon for the sticky header (data-sticky-header="true").
I tried to create something using bootstrap 5 dropdown and attach it to the title, and it works great, but when the sticky header is activated (scroll the head out of view so it kicks in), the filter and the dropdown stop working.
Here is the example, you can see that it works fine until you try to scroll down.
Maybe someone has a solution or option to use a custom sticky header that would work?
Edit:
Followed by T J answer to change the overflow, it fixed the problem where the dropdown wouldn't show on the sticky header. There was a problem where the filter wouldn't apply, and I fixed it by changing:
const checkboxList = document
.querySelector("#departmentDropdownMenu")
.querySelectorAll("input");
to:
const dropdownUL = cb.parentElement.parentElement.parentElement;
const checkboxList = dropdownUL.querySelectorAll("input");
But now a problem that I am having is that when I scroll, this filter apply once but then if I click on the dropdown again it "reset" to how it was when it started (when I scrolled past it's entry point). It changes the filter but on view it appear to "reset" to that position every time. If something is checked there when I started scrolling it will appear checked everytime the dropdown opens again. I made the updates to this example
filterAlgorithm: clearFilter ? () => true : (row, filters) => filters[row._department_data.department],
does this affect the checkbox state? Where did you find documentation of these callbacks, I can't find it – T J