fix(hide-columns): fix repositioning of table hiders onclick
This commit is contained in:
parent
8e03a68e6d
commit
9d8ca38f2e
@ -78,9 +78,9 @@ export class HideColumns {
|
|||||||
}
|
}
|
||||||
|
|
||||||
hideHiderBehindHeader(hider) {
|
hideHiderBehindHeader(hider) {
|
||||||
// move hider right before table (inside any scrolltable element)
|
if (!this._tableHiderContainer.contains(hider)) {
|
||||||
this._tableHiderContainer.appendChild(hider);
|
this._tableHiderContainer.appendChild(hider);
|
||||||
// reposition hider
|
}
|
||||||
const thR = this.hiderToHeader.get(hider).getBoundingClientRect();
|
const thR = this.hiderToHeader.get(hider).getBoundingClientRect();
|
||||||
const hR = hider.getBoundingClientRect();
|
const hR = hider.getBoundingClientRect();
|
||||||
const pR = this._tableHiderContainer.getBoundingClientRect();
|
const pR = this._tableHiderContainer.getBoundingClientRect();
|
||||||
@ -103,7 +103,11 @@ export class HideColumns {
|
|||||||
hider.addEventListener('click', (event) => {
|
hider.addEventListener('click', (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
this.switchColumnDisplay(th, hider);
|
this.switchColumnDisplay(th, hider);
|
||||||
this._tableHiderContainer.getElementsByClassName(TABLE_HIDER_CLASS).forEach(hider => this.hideHiderBehindHeader(hider));
|
|
||||||
|
// recompute position for every table hider
|
||||||
|
this._tableHiderContainer.getElementsByClassName(TABLE_HIDER_CLASS).forEach(hider => {
|
||||||
|
this.hideHiderBehindHeader(hider);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
th.addEventListener('mouseover', () => {
|
th.addEventListener('mouseover', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user