Markdown preview: filter hidden elements from scroll sync (fix #281247)

This commit is contained in:
MohamedEmirHajji
2025-12-10 15:54:00 +01:00
parent 4f4ddd8c9c
commit e04a029f0e

View File

@@ -20,7 +20,21 @@ export class CodeLineElement {
}
get isVisible(): boolean {
return !this._detailParentElements.some(x => !x.open);
if (this._detailParentElements.some(x => !x.open)) {
return false;
}
const style = window.getComputedStyle(this.element);
if (style.display === 'none' || style.visibility === 'hidden') {
return false;
}
const bounds = this.element.getBoundingClientRect();
if (bounds.height === 0 && bounds.width === 0) {
return false;
}
return true;
}
}